From 4624de6162ec0bf2e7d1720dbf09b560a202f64d Mon Sep 17 00:00:00 2001 From: James Baker Date: Sun, 17 May 2015 09:47:37 +0100 Subject: [PATCH 01/56] Initial commit --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..488a0c3 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# week-three-library-carpentry From b644df58765b8e555b13b333a5ab0cbc60014b9c Mon Sep 17 00:00:00 2001 From: James Baker Date: Sun, 17 May 2015 09:56:45 +0100 Subject: [PATCH 02/56] Update README.md week three draft lesson plan --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 488a0c3..bc74d14 100644 --- a/README.md +++ b/README.md @@ -1 +1,18 @@ -# week-three-library-carpentry +## Library Carpetry. Week Three: Git + +**Notes: set up website before hand** + +### Hour One +- What is Git. What is GitHub. Basic language. Doing the basics. +- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/))* + +### Hour Two +- Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** +- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by @davanstrien* + +### Hour Three +- Reflecting on what GitHub could be used for in local library setting. Free time to exploring more Software Carpentry lessons and adapting forked repo with suggestions for future Library Carpentry + +### Install for Week Four +- [Firefox](https://www.mozilla.org/en-US/firefox/new/) +- [Open Refine 2.6](http://openrefine.org/download.html) From 779f678c7ded5f8ed53242247cfd214658993653 Mon Sep 17 00:00:00 2001 From: James Baker Date: Sun, 17 May 2015 09:58:58 +0100 Subject: [PATCH 03/56] Update README.md add link to https://github.com/davanstrien --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc74d14..ff13acb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ ### Hour Two - Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** -- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by @davanstrien* +- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by [@davanstrien](https://github.com/davanstrien)* ### Hour Three - Reflecting on what GitHub could be used for in local library setting. Free time to exploring more Software Carpentry lessons and adapting forked repo with suggestions for future Library Carpentry From eb9d3a05ec74bf68d6ca54b64f903f78188f2f2f Mon Sep 17 00:00:00 2001 From: davanstrien Date: Fri, 14 Aug 2015 11:41:00 +0100 Subject: [PATCH 04/56] add lesson draft --- Git_lesson.md | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Git_lesson.md diff --git a/Git_lesson.md b/Git_lesson.md new file mode 100644 index 0000000..a45725d --- /dev/null +++ b/Git_lesson.md @@ -0,0 +1,63 @@ +## Library Carpetry. Week Three: Git + +**Notes: set up website before hand** + + +### Hour One +- What is Git. What is GitHub. Basic language. Doing the basics. +- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/))* +- the problem? loose changes, collaboration, different versions? +- solution: Version control? + +### What is Github? + +Git is a 'free and open source distributed version control system'. We probably know what free and open source means but we might be less sure about what a 'distributed version control system is'. One way to understand what Git and version control systems do is to look at the types of problems they are build to address. + + +* Version control software, - what does that mean? +* Illustrate the problem? - multiple version, different edits, changes break something (both in code and in texts) + + + + + + + + + + + + +#### Language +Push, pull etc. diagrams and illustrations - cheat sheet + +--- +### Hour Two +- Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** +- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by [@davanstrien](https://github.com/davanstrien)* + +Setting up a repository +adding some content +commiting +making some changes +collaborating +managaging conflicts + + +* build template? Basic site? basic HTML/Markdown? +* css style sheet? + +* guidelines handout +* step by step + +### Hour Three +- Reflecting on what GitHub could be used for in local library setting. Free time to exploring more Software Carpentry lessons and adapting forked repo with suggestions for future Library Carpentry + +user contribution to collections? +- editing of resources? +- crowd sourcing - could be an issue? +- making pull requests. + +### Install for Week Four +- [Firefox](https://www.mozilla.org/en-US/firefox/new/) +- [Open Refine 2.6](http://openrefine.org/download.html) From 26a6c14b465de7dd369400480e25f5804be4d9c7 Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sun, 30 Aug 2015 12:42:58 +0100 Subject: [PATCH 05/56] first hour draft --- Git_lesson.md | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index a45725d..2818bd1 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -9,33 +9,44 @@ - the problem? loose changes, collaboration, different versions? - solution: Version control? -### What is Github? +### What is Git? -Git is a 'free and open source distributed version control system'. We probably know what free and open source means but we might be less sure about what a 'distributed version control system is'. One way to understand what Git and version control systems do is to look at the types of problems they are build to address. +Git is a 'free and open source distributed version control system'. We probably know what free and open source means but we might be less sure about what a 'distributed version control system is'. One way to understand what Git and version control systems do is to look at the types of problems they are built to address. +![PhD comics](http://www.phdcomics.com/comics/archive/phd101212s.gif) -* Version control software, - what does that mean? -* Illustrate the problem? - multiple version, different edits, changes break something (both in code and in texts) +Many of us will have had an experience similar to this. We are working on an important piece of work and we attempt to maintain multiple version of this document in different stages of completeness. +Version control addresses this problem by recording the changes we make to a document as we proceed. Each of the 'commits' we make is recorded and we can go back across a document or a set of documents and look at what changes have been made. +Version control allow us to take this one step further and not only record changes to a document one person is working on but allows multiple people to work on a document and record the changes they make. It is then possible to merge these multiple documents. This developed out of a need for groups writing code together to be able to work on coding projects together without having to wait for someone else to finish working on something or having to manually compare changes that are made. +When we make 'commits' we record a range of metadata about that change. As librarians we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date of when a commit was made. Although we can often see inforamtion about when we last edited or saved a document this only shows us the most recent changes. When we make commits we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. +#### Git vs. Github vs. Gitlab +We often hear the terms Git and Github used interchangeably but the are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems like mercurial and SVN). Github is a popular site which hosts git repositories. The majority of the content that Github hosts is open source software though increasingly it is being used for other projects such as open access journals and constantly updated text books. Github is a great place to learn how to use Git but once you have learned the ideas and processes behid github you can used Git on other storage systems or host repositories on your own server if you wanted to keep code private or you wanted to encrypt your repository. +#### Using Git +One of the main barriers to getting started with git is the language. Although some of the language used in Git is fairly self explanatory other terms are not so clear. The best way to get to learn Git language is to begin using it but having an overview of the language and way Git is used will provide a good starting point. +Push, pull etc. diagrams and illustrations - cheat sheet -#### Language -Push, pull etc. diagrams and illustrations - cheat sheet + +Intro to git site - test some commands +https://try.github.io/ --- ### Hour Two - Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** - *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by [@davanstrien](https://github.com/davanstrien)* +Github pages + Setting up a repository adding some content commiting From 33b88e8e8c0009a40a9e1dc6155de1573afa7499 Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sun, 30 Aug 2015 15:57:20 +0100 Subject: [PATCH 06/56] add hour two material --- Git_lesson.md | 65 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 49 insertions(+), 16 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 2818bd1..c565e7d 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -23,40 +23,72 @@ Version control allow us to take this one step further and not only record chang When we make 'commits' we record a range of metadata about that change. As librarians we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date of when a commit was made. Although we can often see inforamtion about when we last edited or saved a document this only shows us the most recent changes. When we make commits we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. -#### Git vs. Github vs. Gitlab +### Git vs. Github vs. Gitlab -We often hear the terms Git and Github used interchangeably but the are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems like mercurial and SVN). Github is a popular site which hosts git repositories. The majority of the content that Github hosts is open source software though increasingly it is being used for other projects such as open access journals and constantly updated text books. Github is a great place to learn how to use Git but once you have learned the ideas and processes behid github you can used Git on other storage systems or host repositories on your own server if you wanted to keep code private or you wanted to encrypt your repository. +We often hear the terms Git and Github used interchangeably but the are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems like mercurial and SVN). Github is a popular site which hosts git repositories. The majority of the content that Github hosts is open source software though increasingly it is being used for other projects such as open access journals and constantly updated text books. Github is a great place to learn how to use Git but once you have learned the ideas and processes behind github you can used Git on other storage systems or host repositories on your own server if you wanted to keep code private or you wanted to encrypt your repository. - -#### Using Git +### Using Git One of the main barriers to getting started with git is the language. Although some of the language used in Git is fairly self explanatory other terms are not so clear. The best way to get to learn Git language is to begin using it but having an overview of the language and way Git is used will provide a good starting point. +#### Some basics + + + +**Repository** A repository is the place where are projects and associated changes are stored. Repositories can contain one single readme file or hundreds of different folders making up the source code for extensive projects. We can create repositories in a number of different ways; we can make our own from scratch, we can fork (copy) an existing repository or we can create a git repository from an existing folder we have been working on. + +#### Work through some commands online +[https://try.github.io/]() + + +Git cheat sheet handouts +* https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf +* http://www.git-tower.com/blog/git-cheat-sheet/ -Intro to git site - test some commands -https://try.github.io/ --- ### Hour Two - Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** - *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by [@davanstrien](https://github.com/davanstrien)* -Github pages +## Github Pages + +Github Pages are websites hosted on Github. They allow you to build a repository that displays as a website. Github pages uses Jekyll, a 'blog aware static site generator' to turn a site of files and folders into a webpage. + +### Why Github pages are awesome! + +Github pages allow you to version control your website. This is useful for a lot different reasons. It allows you to keep a record of what changes you have made. It allows people to reference your website at a particular point in time and (if you make you're source open) to see what it was like at that particular point in time. This is very useful for academic citations. Most people have had the experience of following up a reference to a website and either getting a 404 error or seeing something completely different. Although using version on your site doesn't guarantee this won't happen it does make it easier to manage old versions of your site. + +Github pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need fixing), list things to do in the future and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. + +### Setting up a Github page + +Suggestions on repositories to fork (is it important to use command line?) + + +* https://github.com/barryclark/jekyll-now -Setting up a repository -adding some content -commiting -making some changes -collaborating -managaging conflicts +- [Hyde](https://github.com/poole/hyde) by MDO +- [Lanyon](https://github.com/poole/lanyon) by MDO +- [mojombo.github.io](https://github.com/mojombo/mojombo.github.io) by Tom Preston-Werner +- [Left](https://github.com/holman/left) by Zach Holman +- [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes) by Michael Rose +- [Skinny Bones](https://github.com/mmistakes/skinny-bones-jekyll) by Michael Rose +Clone Repository +Add some content -* build template? Basic site? basic HTML/Markdown? -* css style sheet? +* in Groups make sure everyone tries committing - pulling changes to their computer +* demonstrate how pull requests can be discussed. * guidelines handout * step by step @@ -68,6 +100,7 @@ user contribution to collections? - editing of resources? - crowd sourcing - could be an issue? - making pull requests. +- open access journals ### Install for Week Four - [Firefox](https://www.mozilla.org/en-US/firefox/new/) From 2d426041a70d988bd842e57dec70e9155b7495dc Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sun, 18 Oct 2015 16:06:58 +0100 Subject: [PATCH 07/56] outline for hour two step-by-step insturctions. Suggestions for hour two format --- Git_lesson.md | 237 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 211 insertions(+), 26 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index c565e7d..1ebd452 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -30,31 +30,226 @@ We often hear the terms Git and Github used interchangeably but the are slightly ### Using Git One of the main barriers to getting started with git is the language. Although some of the language used in Git is fairly self explanatory other terms are not so clear. The best way to get to learn Git language is to begin using it but having an overview of the language and way Git is used will provide a good starting point. -#### Some basics + - +### Some Git commands/language - what they mean and how to use them **Repository** A repository is the place where are projects and associated changes are stored. Repositories can contain one single readme file or hundreds of different folders making up the source code for extensive projects. We can create repositories in a number of different ways; we can make our own from scratch, we can fork (copy) an existing repository or we can create a git repository from an existing folder we have been working on. - ~~~ $ mkdir git_test $ cd git_test $ git init ~~~ -> -#### Work through some commands online -[https://try.github.io/]() - +**git status** +we can use git status at any time to let us know what git is up to. + +if we try it now we should get something like this +~~~ +$ On branch master +$ Initial commit +$ nothing to commit (create/copy files and use "git add" to track) +~~~ + +This is telling us that we are on the master branch (more on this later) and that we have nothing to commit (nothing to save changes from). +If we use list directory we can see currently we don't have any files to track. Lets change that an add a txt file. + +~~~ +$ ls +$ touch git_test.txt +~~~ + +We now have a txt file. If we try git status again we will get the following + +~~~ +$ git status +On branch master +Initial commit +Untracked files: + (use "git add ..." to include in what will be committed) + + git_test.txt + +nothing added to commit but untracked files present (use "git add" to track) +~~~ +This status is git telling us that it has noticed a new file in our directory that we currently aren't tracking. + +To change this and to tell git we want to track changes we make to git_test.txt we can use **git add** + +~~~ +$ git add git_test.txt +~~~ +This adds our txt file to the **staging area** (the area where git checks for file changes). Because we can't see that this has happened we might want to use **git status** again. +~~~ +$ git status +On branch master + +Initial commit + +Changes to be committed: + (use "git rm --cached ..." to unstage) + + new file: git_test.txt +~~~ + +We can see that the file has changed colour and git also tells us that it has got a new file. + +Lets make some changes to this file before we commit +~~~ +$ open git_test.txt +~~~ +We should now be able to add some text to our text file. For now lets just write 'hello world'. If we try **git status** again. We should get the following message +~~~ +Changes not staged for commit: + (use "git add ..." to update what will be committed) + (use "git checkout -- ..." to discard changes in working directory) + + modified: git_test.txt +~~~ +This lets us know that Git has spotted changes to our txt file but that it hasn't yet 'staged them'. This means git won't currently record the changes we made. We can add the file to the staging area again +~~~ +git add git_test.txt +~~~ +We can now **commit** our first changes. Commit is similar to 'saving' a file to git. However compared to saving a lot more information about the changes we made is recorded and visible to us later. +~~~ +git commit -m 'hello world' +[master (root-commit) 27c3f19] hello world + 1 file changed, 1 insertion(+) + create mode 100644 git_test.txt +~~~ +We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment if we wanted to work with someone else they would have no way of seeing what we've done. Lets fix that. Lets jump to the github website where we could decide to host some of work. Hosting here will allow us to share our work with friend and collegues but also allow other people to use or build on our work. + +*** + +When we have logged in to github we will see an option to create a new repository. Lets make one for the github experiments we are going to do today. + +* new repository +* give it a name + +once we have made our repository we still need to link the repository we have on our computer and the one we've just made. + +~~~ +$ git remote add origin +~~~ + +This will add a repository on github for our changes to be commited to. +~~~ +$ git push -u origin master +~~~ + +**git push** will add changes to our repository. The name of our remote is origin and the default local branch name is master. The -u tells Git to remember the parameters, so that next time we can simply run git push and Git will know what to do. Go ahead and push it! + +When we type this command we will see git 'pushing' changes to github. Because our file is very small this won't take long but if we have made a lot of changes or are adding a very large repository we may have to wait a little longer. +We can get to see where we're at with **git status** +~~~ +On branch master +Your branch is up-to-date with 'origin/master'. + +nothing to commit, working directory clean +~~~ +This is letting us know where we are working (the master branch). We can also see that we have no changes to commit and everything is in order. + +We can use **git diff** to see changes we have made before making a commit. +Lets add another line to our text file. +~~~ +$ open git_test.txt +$ git diff +diff --git a/git_test.txt b/git_test.txt +index 70c379b..1d55e1a 100644 +--- a/git_test.txt ++++ b/git_test.txt +@@ -1 +1,2 @@ +-Hello world +\ No newline at end of file ++Hello world ++More changes to my first github file +\ No newline at end of file +~~~ + +We can see the changes we have made. + +1. The first line tells us that Git is producing output similar to the Unix diff command comparing the old and new versions of the file. +2. The second line tells exactly which versions of the file Git is comparing; df0654a and 315bf3a are unique computer-generated labels for those versions. +3. The third and fourth lines once again show the name of the file being changed. +4. The remaining lines are the most interesting, they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. + +We can now commmit these changes again +~~~ +$ git add git_test.txt +$ git commit -m 'second line of changes' +~~~ + +Say we are very forgetful and have already forgotten what we changes we have made. **git log** allows us to look at what we have been doing to our git repository. + +~~~ +$ git status +commit 40d3f7af25e19c06fa839a570d51e38fdb374e80 +Author: davanstrien +Date: Sun Oct 18 15:25:19 2015 +0100 + + second line of changes + +commit 27c3f19c3340d930234d592928b11b63403d0696 +Author: davanstrien +Date: Sun Oct 18 13:27:31 2015 +0100 + + hello world +~~~ + +This shows us the two commits we have made and shows the messages we wrote. It is important that we try and use meangiful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. + +We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that it is worth learning one more command. **git pull** + +We can try and see how this works by making changes on the github website and then 'pulling' them onto our computer. + +Lets go to our respository. We can see our txt file and make changes. However, you may have noticed only our first change is there. This is because we didn't push our last commit yet. This might seem like a mistake in design but it is often useful to make a lot of commits for small changes so you are able to make careful revisions later and you don't necessarily want to push all these changes one by one. + +Lets go back and push our changes + +~~~ +$ git push +~~~ + +now if we go back to our github repo we can see all our changes. Lets add an extra line of text and commit these changes. When we commit changes on github itself we don't have to push these. + +Now lets get the third line onto our computer. +~~~ +$ git pull +remote: Counting objects: 3, done. +remote: Compressing objects: 100% (2/2), done. +remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 +Unpacking objects: 100% (3/3), done. +From https://github.com/davanstrien/git_lesson_example + 40d3f7a..ef95e51 master -> origin/master +Updating 40d3f7a..ef95e51 +Fast-forward + git_test.txt | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) +~~~ + +If we open our text file again +~~~ +$ open git_test.txt +~~~ +we can see our new lines. + +When we begin collobarating on more complex projects we may have to consider more aspects of git functionality but this should be a good start. In the second hour we can look more closely at collobarating and using github pages. + +--- Git cheat sheet handouts * https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf * http://www.git-tower.com/blog/git-cheat-sheet/ - - --- ### Hour Two - Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** @@ -62,7 +257,7 @@ Git cheat sheet handouts ## Github Pages -Github Pages are websites hosted on Github. They allow you to build a repository that displays as a website. Github pages uses Jekyll, a 'blog aware static site generator' to turn a site of files and folders into a webpage. +Github Pages are websites hosted on Github. They allow you to build a repository that displays as a website. Github pages uses Jekyll, a 'blog aware static site generator' to turn a site of files and folders into a website. ### Why Github pages are awesome! @@ -72,24 +267,12 @@ Github pages also mean that you can collaborate on a website with a lot of peopl ### Setting up a Github page -Suggestions on repositories to fork (is it important to use command line?) - - -* https://github.com/barryclark/jekyll-now - -- [Hyde](https://github.com/poole/hyde) by MDO -- [Lanyon](https://github.com/poole/lanyon) by MDO -- [mojombo.github.io](https://github.com/mojombo/mojombo.github.io) by Tom Preston-Werner -- [Left](https://github.com/holman/left) by Zach Holman -- [Minimal Mistakes](https://github.com/mmistakes/minimal-mistakes) by Michael Rose -- [Skinny Bones](https://github.com/mmistakes/skinny-bones-jekyll) by Michael Rose - -Clone Repository -Add some content - +Suggestion for second hour. +Use github page generator to set up a github page site. +* clone repo (add instructions) +* add other users (perhaps start with teams of two) * in Groups make sure everyone tries committing - pulling changes to their computer * demonstrate how pull requests can be discussed. - * guidelines handout * step by step @@ -102,6 +285,8 @@ user contribution to collections? - making pull requests. - open access journals + + ### Install for Week Four - [Firefox](https://www.mozilla.org/en-US/firefox/new/) - [Open Refine 2.6](http://openrefine.org/download.html) From f41129d3511f37404e0b27c0372841e408437add Mon Sep 17 00:00:00 2001 From: drjwbaker Date: Wed, 21 Oct 2015 10:05:27 +0100 Subject: [PATCH 08/56] fixed small typo --- Git_lesson.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index 1ebd452..0ebaaaa 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -182,7 +182,7 @@ We can see the changes we have made. 3. The third and fourth lines once again show the name of the file being changed. 4. The remaining lines are the most interesting, they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. -We can now commmit these changes again +We can now commit these changes again ~~~ $ git add git_test.txt $ git commit -m 'second line of changes' From 69db6244609aff64dfd22949576aa28de6eb168d Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 27 Oct 2015 14:14:18 +0000 Subject: [PATCH 09/56] outline hour two tasks --- Git_lesson.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 1ebd452..c41da8d 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -252,8 +252,14 @@ Git cheat sheet handouts --- ### Hour Two -- Collaborating in groups to build a Github Pages site: who they are, what they think they could use GitHub for **setup a template for use beforehand?** -- *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)). To be worked on by [@davanstrien](https://github.com/davanstrien)* +* First 20 minutes or so - reinforcing how git works. +* Draw diagrams of things covered so far +* express language in 'non git' way. + +* Build on first hour and make pull requests to a github pages site. @davanstrien Setup before hand. site will link to some repositories useful for librarians/dh. +* examples of collobarative working on github links +* forking a github page. + ## Github Pages From 08f5589ec3da6cdd685165260eb3e4ef8c88c02c Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 3 Nov 2015 11:13:48 +0000 Subject: [PATCH 10/56] Update Git_lesson.md --- Git_lesson.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Git_lesson.md b/Git_lesson.md index c41da8d..0c1c4d6 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -260,6 +260,10 @@ Git cheat sheet handouts * examples of collobarative working on github links * forking a github page. +## Lets review + +It is likely that not e + ## Github Pages @@ -272,6 +276,7 @@ Github pages allow you to version control your website. This is useful for a lot Github pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need fixing), list things to do in the future and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. ### Setting up a Github page +Now we're all persuaded of how awesome Github pages are (or you've identfied some fatal flaws in my reasoning) it would be useful to try playing around with some things we can do with Github pages. This will help us cement what we have learned in the previous hour and may help spark discussion for the last section of this session. Suggestion for second hour. Use github page generator to set up a github page site. From d7a2d7e6b8378748b29d68f6c51ecffce2d5d681 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 3 Nov 2015 15:31:53 +0000 Subject: [PATCH 11/56] Update Git_lesson.md --- Git_lesson.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 0c1c4d6..57b5c18 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -253,8 +253,8 @@ Git cheat sheet handouts --- ### Hour Two * First 20 minutes or so - reinforcing how git works. -* Draw diagrams of things covered so far -* express language in 'non git' way. + - Draw diagrams of things covered so far + - express language in 'non git' way. * Build on first hour and make pull requests to a github pages site. @davanstrien Setup before hand. site will link to some repositories useful for librarians/dh. * examples of collobarative working on github links @@ -262,8 +262,13 @@ Git cheat sheet handouts ## Lets review -It is likely that not e +It is likely that some things won't have stuck from the last hour. To try and reinforce how things work we can work in groups to develop diagrams to illustrate Git functions and language. This should make carrying out more complicated aspects of Git clearer in our heads. +In groups: + +* illustrate the concepts discussed in the first hour +* try and 'draw' what different commands mean +* try and come up with synonyms for what the commands are doing. ## Github Pages From 34364e96d993c20f8cf70b6a84ce94a81a0d9764 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 3 Nov 2015 15:35:12 +0000 Subject: [PATCH 12/56] Create library-repos --- library-repos | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 library-repos diff --git a/library-repos b/library-repos new file mode 100644 index 0000000..967ded9 --- /dev/null +++ b/library-repos @@ -0,0 +1,7 @@ +# Useful Library github repos + +* 'Python script for converting MARC21 files to a saner format (CSV), originally designed for the Harvard Libraries MARC21 records' +[DavidChouinard/mrc_to_csv](https://github.com/DavidChouinard/mrc_to_csv) + +process MARC records from Python http://python.org/pypi/pymarc +https://github.com/edsu/pymarc From 6feeaa0dd930fedaeed76d0fc6958b79d4194b83 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 3 Nov 2015 15:46:40 +0000 Subject: [PATCH 13/56] Update library-repos --- library-repos | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/library-repos b/library-repos index 967ded9..e07f03c 100644 --- a/library-repos +++ b/library-repos @@ -5,3 +5,20 @@ process MARC records from Python http://python.org/pypi/pymarc https://github.com/edsu/pymarc + +edsu/git-intro +high level intro to git http://edsu.github.io/git-intro +https://github.com/edsu/git-intro + +https://github.com/edsu/mirador + +https://github.com/edsu/microdata + + +https://github.com/kcl-ddh + +https://github.com/dhtaxonomy/TaDiRAH + +https://github.com/OpenAPC/openapc-de + +https://github.com/JiscMonitor/allapc From 4b2651b7f3f4091b3484c3cce2dc41373d8bd431 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 3 Nov 2015 15:47:22 +0000 Subject: [PATCH 14/56] Update library-repos --- library-repos | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library-repos b/library-repos index e07f03c..a5ac3ea 100644 --- a/library-repos +++ b/library-repos @@ -22,3 +22,5 @@ https://github.com/dhtaxonomy/TaDiRAH https://github.com/OpenAPC/openapc-de https://github.com/JiscMonitor/allapc + +http://fbkarsdorp.github.io/python-course/ From 559bab4b56917499b31e90d19bd294a448756d35 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Tue, 10 Nov 2015 16:47:19 +0000 Subject: [PATCH 15/56] Update Git_lesson.md --- Git_lesson.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 57b5c18..c43ed0a 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -36,7 +36,7 @@ One of the main barriers to getting started with git is the language. Although s **Repository** A repository is the place where are projects and associated changes are stored. Repositories can contain one single readme file or hundreds of different folders making up the source code for extensive projects. We can create repositories in a number of different ways; we can make our own from scratch, we can fork (copy) an existing repository or we can create a git repository from an existing folder we have been working on. -**Init** Create a repository +**init** Create a repository Whenever we use Git on the commnand line we begin our command with Git. This is so the computer knows we are trying to get Git to do something rather than another programme. @@ -88,7 +88,7 @@ To change this and to tell git we want to track changes we make to git_test.txt ~~~ $ git add git_test.txt ~~~ -This adds our txt file to the **staging area** (the area where git checks for file changes). Because we can't see that this has happened we might want to use **git status** again. +This adds our txt file to the **staging area** (the area where git checks for file changes). Because we can't see that this has happened we might want to use **`git status`** again. ~~~ $ git status On branch master From 74601dae316fc8d610c41aa793d75cc022b05abd Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 11 Nov 2015 10:26:07 +0000 Subject: [PATCH 16/56] Create install_instructions --- install_instructions | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 install_instructions diff --git a/install_instructions b/install_instructions new file mode 100644 index 0000000..9054f3a --- /dev/null +++ b/install_instructions @@ -0,0 +1,13 @@ +~ Install for week three + +## Setup a GitHub account +If you don't already have a GitHub account set one up here: [https://github.com/](https://github.com/) + +## Install Git +Follow the instructions for installing Git on your operating system here: +https://help.github.com/articles/set-up-git/. + +These instructions will install a GUI version of Git which we won't be using during the session but might be handy in the future. It will install the command line software at the same time. + +## Configuring your Git setup +http://swcarpentry.github.io/git-novice/02-setup.html From fc0add5255c828c2edfb25e8ce820469fafd0057 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 11 Nov 2015 10:26:23 +0000 Subject: [PATCH 17/56] Rename install_instructions to install_instructions.md --- install_instructions => install_instructions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename install_instructions => install_instructions.md (100%) diff --git a/install_instructions b/install_instructions.md similarity index 100% rename from install_instructions rename to install_instructions.md From 28417d360eb4890ffea47fe8646bc005f5cc69f7 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 11 Nov 2015 10:26:32 +0000 Subject: [PATCH 18/56] Update install_instructions.md --- install_instructions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install_instructions.md b/install_instructions.md index 9054f3a..432a5fa 100644 --- a/install_instructions.md +++ b/install_instructions.md @@ -1,4 +1,4 @@ -~ Install for week three +# Install for week three ## Setup a GitHub account If you don't already have a GitHub account set one up here: [https://github.com/](https://github.com/) From 8a061c2d5010573ba42e3439b0f3f9ad281e7e7c Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 11 Nov 2015 10:40:08 +0000 Subject: [PATCH 19/56] Update Git_lesson.md --- Git_lesson.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index c43ed0a..ce3677e 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -294,6 +294,7 @@ Use github page generator to set up a github page site. ### Hour Three - Reflecting on what GitHub could be used for in local library setting. Free time to exploring more Software Carpentry lessons and adapting forked repo with suggestions for future Library Carpentry +- Helping each other out. user contribution to collections? - editing of resources? @@ -302,7 +303,6 @@ user contribution to collections? - open access journals - ### Install for Week Four - [Firefox](https://www.mozilla.org/en-US/firefox/new/) - [Open Refine 2.6](http://openrefine.org/download.html) From 46565b50e4376f577ad50c5abab007e069ed775d Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 11 Nov 2015 10:58:14 +0000 Subject: [PATCH 20/56] add intro --- Git_lesson.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Git_lesson.md b/Git_lesson.md index ce3677e..bde6c72 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -2,6 +2,19 @@ **Notes: set up website before hand** +### Intro + +#### what we will try and do +**begin** to understand and use Git/Github. You will not be an expert by the end of the evening. You will probably not even feel very comfortable using Git. This is okay. We want to make a start but like any skill using Git takes practice. + +#### be excellent to each other +* If you spot someone that is struggling with something and you think you know how to help give them a hand. Try not to do it for them but explain the steps they need to take and *what* these steps are doing. + +#### be patient with me and yourself +* This is a big group, with different levels of knowledge, different computer systems. +* This isn't my full-time job (though if someone wants to pay me to play with computers all day I'd probably accept). I'll do my best to make this session useful. +* This is your session. If you feel we are going to fast then let me know. We can decide as a group what to cover. + ### Hour One - What is Git. What is GitHub. Basic language. Doing the basics. From 07d09dc6f58afe1ee0b1b86a811ad7050fd953ce Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sat, 14 Nov 2015 12:13:56 +0000 Subject: [PATCH 21/56] less typos --- Git_lesson.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index 1ebd452..7610241 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -4,7 +4,7 @@ ### Hour One -- What is Git. What is GitHub. Basic language. Doing the basics. +- What is Git. What is GitHub. Basic language. Doin g the basics. - *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/))* - the problem? loose changes, collaboration, different versions? - solution: Version control? From 9d1c1a5c0bf5cc7050768670820b60c1edbbe5de Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sat, 14 Nov 2015 12:47:08 +0000 Subject: [PATCH 22/56] update installation instructions --- install_instructions.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/install_instructions.md b/install_instructions.md index 432a5fa..b8f8b64 100644 --- a/install_instructions.md +++ b/install_instructions.md @@ -1,13 +1,24 @@ # Install for week three +* As in week two we will want to use a laptop during this session. +* If you didn't attend week two and haven't using the command line before you will want to make sure if you are using Mac OSx and Linux you know how to get to the command line. If you are on a Windows system you will want to follow the installation instructions from week two. +* Though it isn't completely necessary, it would be helpful if you missed week two to try and understand some of the basic commands for moving between directories on the command line. + ## Setup a GitHub account -If you don't already have a GitHub account set one up here: [https://github.com/](https://github.com/) +* If you don't already have a GitHub account set one up here: [https://github.com/](https://github.com/) ## Install Git -Follow the instructions for installing Git on your operating system here: +* Follow the instructions for installing Git on your operating system here: https://help.github.com/articles/set-up-git/. -These instructions will install a GUI version of Git which we won't be using during the session but might be handy in the future. It will install the command line software at the same time. +* These instructions will install a GUI version of Git which we won't be using during the session but might be handy in the future. It will install the command line software at the same time. ## Configuring your Git setup -http://swcarpentry.github.io/git-novice/02-setup.html +* It will be useful to configure your github setup before we begin week three. +~~~ +$ git config --global user.name "your name" +$ git config --global user.email "your@email" +$ git config --global color.ui "auto" +~~~ + + From 2e7083492cc8ab1fae5181c73014611de0a0fe73 Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sat, 14 Nov 2015 15:51:18 +0000 Subject: [PATCH 23/56] fixed install instructions for windows users --- install_instructions.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install_instructions.md b/install_instructions.md index b8f8b64..b3d15af 100644 --- a/install_instructions.md +++ b/install_instructions.md @@ -4,16 +4,17 @@ * If you didn't attend week two and haven't using the command line before you will want to make sure if you are using Mac OSx and Linux you know how to get to the command line. If you are on a Windows system you will want to follow the installation instructions from week two. * Though it isn't completely necessary, it would be helpful if you missed week two to try and understand some of the basic commands for moving between directories on the command line. -## Setup a GitHub account +## 1. Setup a GitHub account * If you don't already have a GitHub account set one up here: [https://github.com/](https://github.com/) -## Install Git +## 2. Install Git +* For Windows users: make sure you followed the steps for week two then move to step 3. * Follow the instructions for installing Git on your operating system here: https://help.github.com/articles/set-up-git/. * These instructions will install a GUI version of Git which we won't be using during the session but might be handy in the future. It will install the command line software at the same time. -## Configuring your Git setup +## 3. Configuring your Git setup * It will be useful to configure your github setup before we begin week three. ~~~ $ git config --global user.name "your name" @@ -21,4 +22,6 @@ $ git config --global user.email "your@email" $ git config --global color.ui "auto" ~~~ +## Problems +* If you have any difficulties please reach out via email/twitter/in person. From 94c6e8b1fd1d92235ba05b221dd5d2052c53d0c1 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Sun, 15 Nov 2015 16:59:20 +0000 Subject: [PATCH 24/56] Update README.md --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/README.md b/README.md index ff13acb..cab1e6f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,36 @@ ## Library Carpetry. Week Three: Git +### Install for week three + +* As in week two we will want to use a laptop during this session. +* If you didn't attend week two and haven't using the command line before you will want to make sure if you are using Mac OSx and Linux you know how to get to the command line. If you are on a Windows system you will want to follow the installation instructions from week two. +* Though it isn't completely necessary, it would be helpful if you missed week two to try and understand some of the basic commands for moving between directories on the command line. + +### 1. Setup a GitHub account +* If you don't already have a GitHub account set one up here: [https://github.com/](https://github.com/) + +### 2. Install Git +* For Windows users: make sure you followed the steps for week two then move to step 3. +* Follow the instructions for installing Git on your operating system here: +https://help.github.com/articles/set-up-git/. + +* These instructions will install a GUI version of Git which we won't be using during the session but might be handy in the future. It will install the command line software at the same time. + +### 3. Configuring your Git setup +* It will be useful to configure your github setup before we begin week three. +~~~ +$ git config --global user.name "your name" +$ git config --global user.email "your@email" +$ git config --global color.ui "auto" +~~~ + +### Problems +* If you have any difficulties please reach out via email/twitter/in person. + + + + + **Notes: set up website before hand** ### Hour One From 7405c034b92e16c67609997cc94465a1d6ac0990 Mon Sep 17 00:00:00 2001 From: davanstrien Date: Sun, 15 Nov 2015 17:04:12 +0000 Subject: [PATCH 25/56] hour two outline --- Git_lesson.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index ae2c644..d41b25c 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -26,7 +26,7 @@ Git is a 'free and open source distributed version control system'. We probably know what free and open source means but we might be less sure about what a 'distributed version control system is'. One way to understand what Git and version control systems do is to look at the types of problems they are built to address. -![PhD comics](http://www.phdcomics.com/comics/archive/phd101212s.gif) + Many of us will have had an experience similar to this. We are working on an important piece of work and we attempt to maintain multiple version of this document in different stages of completeness. @@ -94,6 +94,7 @@ Untracked files: nothing added to commit but untracked files present (use "git add" to track) ~~~ + This status is git telling us that it has noticed a new file in our directory that we currently aren't tracking. To change this and to tell git we want to track changes we make to git_test.txt we can use **git add** @@ -101,7 +102,9 @@ To change this and to tell git we want to track changes we make to git_test.txt ~~~ $ git add git_test.txt ~~~ + This adds our txt file to the **staging area** (the area where git checks for file changes). Because we can't see that this has happened we might want to use **`git status`** again. + ~~~ $ git status On branch master @@ -117,10 +120,13 @@ Changes to be committed: We can see that the file has changed colour and git also tells us that it has got a new file. Lets make some changes to this file before we commit + ~~~ $ open git_test.txt ~~~ + We should now be able to add some text to our text file. For now lets just write 'hello world'. If we try **git status** again. We should get the following message + ~~~ Changes not staged for commit: (use "git add ..." to update what will be committed) @@ -128,17 +134,22 @@ Changes not staged for commit: modified: git_test.txt ~~~ + This lets us know that Git has spotted changes to our txt file but that it hasn't yet 'staged them'. This means git won't currently record the changes we made. We can add the file to the staging area again + ~~~ git add git_test.txt ~~~ + We can now **commit** our first changes. Commit is similar to 'saving' a file to git. However compared to saving a lot more information about the changes we made is recorded and visible to us later. + ~~~ git commit -m 'hello world' [master (root-commit) 27c3f19] hello world 1 file changed, 1 insertion(+) create mode 100644 git_test.txt ~~~ + We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment if we wanted to work with someone else they would have no way of seeing what we've done. Lets fix that. Lets jump to the github website where we could decide to host some of work. Hosting here will allow us to share our work with friend and collegues but also allow other people to use or build on our work. *** @@ -173,6 +184,7 @@ This is letting us know where we are working (the master branch). We can also se We can use **git diff** to see changes we have made before making a commit. Lets add another line to our text file. + ~~~ $ open git_test.txt $ git diff @@ -196,6 +208,7 @@ We can see the changes we have made. 4. The remaining lines are the most interesting, they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. We can now commmit these changes again + ~~~ $ git add git_test.txt $ git commit -m 'second line of changes' @@ -235,6 +248,7 @@ $ git push now if we go back to our github repo we can see all our changes. Lets add an extra line of text and commit these changes. When we commit changes on github itself we don't have to push these. Now lets get the third line onto our computer. + ~~~ $ git pull remote: Counting objects: 3, done. @@ -250,9 +264,11 @@ Fast-forward ~~~ If we open our text file again + ~~~ $ open git_test.txt ~~~ + we can see our new lines. When we begin collobarating on more complex projects we may have to consider more aspects of git functionality but this should be a good start. In the second hour we can look more closely at collobarating and using github pages. From 5225f7e57b06b3443cb7896b4b2f3b6c9eb71e5a Mon Sep 17 00:00:00 2001 From: drjwbaker Date: Tue, 17 Nov 2015 10:09:39 +0000 Subject: [PATCH 26/56] added half way mark self reporting excercise to beginning of lesson --- Git_lesson.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Git_lesson.md b/Git_lesson.md index d00825e..55af4b9 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -2,6 +2,10 @@ **Notes: set up website before hand** +### Self-reporting + +(James) In addition to the skill level self-reporting you've been doing, now we've hit the half way point of Library Carpentry we'd like to know if you are feeling able to articulate ways in which what we've learnt thus far could be used in your daily practice. So for the next two minutes, please write *briefly* on a sticky note a scenario in which you imagine - that is, not necessarily right now but with a little practice - you or your team will be able to use what you've learnt thus far at work, in your libraries. And if you can't see an application, then tell us that! + ### Intro #### what we will try and do From 7080533d24b1cd9a4a8bf8b376f0e61fc6a1e051 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 18 Nov 2015 12:01:49 +0000 Subject: [PATCH 27/56] Update library-repos --- library-repos | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library-repos b/library-repos index a5ac3ea..4b1fd4e 100644 --- a/library-repos +++ b/library-repos @@ -24,3 +24,5 @@ https://github.com/OpenAPC/openapc-de https://github.com/JiscMonitor/allapc http://fbkarsdorp.github.io/python-course/ + +https://galencharlton.com/blog/2008/03/code4lib-2008-lightning-talk-git-and-distributed-cataloging/ From 0e6dbc8356133ec7c8e193f9f18cfcf2c182f1aa Mon Sep 17 00:00:00 2001 From: davanstrien Date: Wed, 18 Nov 2015 21:14:36 +0000 Subject: [PATCH 28/56] create draft handout --- handout.md | 93 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 handout.md diff --git a/handout.md b/handout.md new file mode 100644 index 0000000..26c1d0f --- /dev/null +++ b/handout.md @@ -0,0 +1,93 @@ +--- +title: Library Carpentry Week Three Versioning Data with Git +--- + +Schedule: + +* 17:45-18:25 Git and Github +* 18:30-19:25 Github pages and Markdown +* 19:30-20:25 Practice and/or discussion + +--- + +### Basics - navigating the shell + +**`pwd`** print working directory + +**`ls`** list directory + +- `-l`: list file information +- `-lh`: list human readable file information + +**`cd`** change directory + +______ +### Basics - interacting with files + +**`mkdir`** make directory + +**`cat`** send file or files to output (in most cases, print to shell) + +**`head`** output first parts of a file or files + +**`tail`** output last parts of a file or files + +**`mv`** rename or move a file or files. Syntax for renaming a file: `mv FILENAME NEWFILENAME` + +**`cp`** copy a file or files. Syntax: `cp FILENAME NEWFILENAME` + +**`>`** redirect output. Syntax with `cat`: `cat FILENAME1 FILENAME2 > NEWFILENAME` + +**`rm`** remove a file or files. NB: *USE WITH CAUTION!!!* + +--- + +### Basic Git commands + +**`git init`**: creates a git repository + +**`git status`** : view the status of your files in the working directory and staging area + +**`git add`**: tells git to start tracking a file, or a series of files. + +**`git commit`**: commits 'saves' the staged snapshot to the project history. + +**`git push`**: commits the staged snapshot to the project history. + +**`git diff`**: shows changes made to files + +**`git pull`**: Merges upstream changes into your local repository + +**`git remote add origin`**: add a repository where changes will be stored + - We will use `git remote add origin ` +--- + +### Exercise our first git repository +We will try and do this session as a group but if prefer to go at a slower pace please follow the instructions on the week three library carpentry github page. + +### Exercise - visualising git + +In groups work spend some time trying to illustrate some of the commands we've used with Git: + +* try and express git commands in a non 'git' way +* try and visualise what commits are doing to your repository + +If you want to practice more feel free to keep practicising making changes to your file and committing the changes. If you want to explore more git commands search for some more online or follow one of the suggested links below. + +### Exercise - contributing to a github pages site + + + +- pull requests +- set up site to pull from +- outline some activities for interacting with github pages +- instructions for pull requests +- Pull request 'in browser' and by forking + +### Further reading + +* https://help.github.com/ +* https://guides.github.com/activities/hello-world/ +* https://www.atlassian.com/git/tutorials + + From add5ef07a33f24504177a124990662995c1185c2 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Wed, 18 Nov 2015 21:17:30 +0000 Subject: [PATCH 29/56] Update handout.md --- handout.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handout.md b/handout.md index 26c1d0f..5aa9130 100644 --- a/handout.md +++ b/handout.md @@ -58,8 +58,8 @@ ______ **`git pull`**: Merges upstream changes into your local repository -**`git remote add origin`**: add a repository where changes will be stored - - We will use `git remote add origin ` +**`git remote add origin`**: add a repository where changes will be stored - + --- ### Exercise our first git repository From 09e962d07dc6c8bfaea1157f891f4eb34e4fb69f Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Thu, 19 Nov 2015 10:00:23 +0000 Subject: [PATCH 30/56] third exercise --- handout.md | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/handout.md b/handout.md index 5aa9130..82f9aad 100644 --- a/handout.md +++ b/handout.md @@ -74,15 +74,20 @@ In groups work spend some time trying to illustrate some of the commands we've u If you want to practice more feel free to keep practicising making changes to your file and committing the changes. If you want to explore more git commands search for some more online or follow one of the suggested links below. -### Exercise - contributing to a github pages site - +### Exercise - contributing to a github pages site + +To practice using Git, Github pages and Markdown we can contribute to a Github pages site. This page is currently very bare but we can change that by making some pull requests and suggesting changes. + +#### pull-request (slightly easier way) +* Navigate to the repo. +* Click on 'fork' repository. You will then be asked to choose where to 'fork' your repository. +* Once we have our own fork we can edit files directly from the github site. This is a good chance to practice some markdown syntax. You can preview how it will look before you commit changes.NB this is 'github' flavour of markdown, there are slight differences between different 'flavours'. +* Once we have done this we can commit our changes. +* If we've made some changes which we think would be worth adding to the original site then we can make a pull request. This slightly confusing terminology basically means you are asking the owner of the original source if they would like to add (pull) some of your changes into their version. +* Click on compare changes. This will show you if there are any differences between the two version you have. From here we can make a pull request. +* When we make a pull request we have the option of explaining what the pull request relates to. It is important we try and give a short concise expanation of what it is about. -- pull requests -- set up site to pull from -- outline some activities for interacting with github pages -- instructions for pull requests -- Pull request 'in browser' and by forking ### Further reading From 749d161deb9dee8e9d5303b0313f9c6fcad321f0 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Thu, 19 Nov 2015 10:01:42 +0000 Subject: [PATCH 31/56] Update library-repos --- library-repos | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library-repos b/library-repos index 4b1fd4e..1bb51d3 100644 --- a/library-repos +++ b/library-repos @@ -26,3 +26,5 @@ https://github.com/JiscMonitor/allapc http://fbkarsdorp.github.io/python-course/ https://galencharlton.com/blog/2008/03/code4lib-2008-lightning-talk-git-and-distributed-cataloging/ + +http://book.openingscience.org/ From e6b8b35a96e0839c1f9b1feab2954cf055738983 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Thu, 19 Nov 2015 10:36:31 +0000 Subject: [PATCH 32/56] Update handout.md --- handout.md | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/handout.md b/handout.md index 82f9aad..654b38b 100644 --- a/handout.md +++ b/handout.md @@ -80,19 +80,24 @@ If you want to practice more feel free to keep practicising making changes to yo To practice using Git, Github pages and Markdown we can contribute to a Github pages site. This page is currently very bare but we can change that by making some pull requests and suggesting changes. #### pull-request (slightly easier way) -* Navigate to the repo. -* Click on 'fork' repository. You will then be asked to choose where to 'fork' your repository. -* Once we have our own fork we can edit files directly from the github site. This is a good chance to practice some markdown syntax. You can preview how it will look before you commit changes.NB this is 'github' flavour of markdown, there are slight differences between different 'flavours'. -* Once we have done this we can commit our changes. -* If we've made some changes which we think would be worth adding to the original site then we can make a pull request. This slightly confusing terminology basically means you are asking the owner of the original source if they would like to add (pull) some of your changes into their version. -* Click on compare changes. This will show you if there are any differences between the two version you have. From here we can make a pull request. -* When we make a pull request we have the option of explaining what the pull request relates to. It is important we try and give a short concise expanation of what it is about. - +1. Navigate to the repo. +2. Click on 'fork' repository. You will then be asked to choose where to 'fork' your repository. +3. Once we have our own fork we can edit files directly from the github site. This is a good chance to practice some markdown syntax. You can preview how it will look before you commit changes.NB this is 'github' flavour of markdown, there are slight differences between different 'flavours'. +4. Once we have done this we can commit our changes. +5. If we've made some changes which we think would be worth adding to the original site then we can make a pull request. This slightly confusing terminology basically means you are asking the owner of the original source if they would like to add (pull) some of your changes into their version. +6. Click on compare changes. This will show you if there are any differences between the two version you have. From here we can make a pull request. +7. When we make a pull request we have the option of explaining what the pull request relates to. It is important we try and give a short concise expanation of what it is about. + +#### pull-request (slightly more complicated way) +* instead of making edits on the github website you can 'clone' the repository to your local machine. +* follow steps 1 and 2 above. +* then follow the steps outline here: http://www.thinkful.com/learn/github-pull-request-tutorial/Writing-a-Good-Commit-Message ### Further reading * https://help.github.com/ * https://guides.github.com/activities/hello-world/ * https://www.atlassian.com/git/tutorials +* programminghistorian.org From 9e50d5f0f6ca9f69db5c7f8490f0761a0b2373fd Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Thu, 19 Nov 2015 10:47:07 +0000 Subject: [PATCH 33/56] Update handout.md --- handout.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/handout.md b/handout.md index 654b38b..ae96018 100644 --- a/handout.md +++ b/handout.md @@ -95,9 +95,10 @@ To practice using Git, Github pages and Markdown we can contribute to a Github p ### Further reading -* https://help.github.com/ -* https://guides.github.com/activities/hello-world/ -* https://www.atlassian.com/git/tutorials -* programminghistorian.org +* The help pages of github are a good place to start: https://help.github.com/ +* Github has 'activities' which aim to explain how git works: https://guides.github.com/activities/hello-world/ +* Some indepth but clear tutorials on using git. https://www.atlassian.com/git/tutorials +* A website aimed at historians but useful for librarians/those interested in Digital Humanities. The project uses Github and a programme called Jekyll to manage new lessons/the website. A useful place to see a non coding use of github in action: programminghistorian.org + From dc380cf97c4a9eaa657bb61a5853c78e92b28248 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Fri, 20 Nov 2015 09:31:22 +0000 Subject: [PATCH 34/56] Update handout.md --- handout.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/handout.md b/handout.md index ae96018..3db95cf 100644 --- a/handout.md +++ b/handout.md @@ -93,12 +93,7 @@ To practice using Git, Github pages and Markdown we can contribute to a Github p * follow steps 1 and 2 above. * then follow the steps outline here: http://www.thinkful.com/learn/github-pull-request-tutorial/Writing-a-Good-Commit-Message -### Further reading -* The help pages of github are a good place to start: https://help.github.com/ -* Github has 'activities' which aim to explain how git works: https://guides.github.com/activities/hello-world/ -* Some indepth but clear tutorials on using git. https://www.atlassian.com/git/tutorials -* A website aimed at historians but useful for librarians/those interested in Digital Humanities. The project uses Github and a programme called Jekyll to manage new lessons/the website. A useful place to see a non coding use of github in action: programminghistorian.org From 73d8064a95fdfedc9f0673eee581c25f7ba1e034 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Fri, 20 Nov 2015 09:34:29 +0000 Subject: [PATCH 35/56] Update handout.md --- handout.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handout.md b/handout.md index 3db95cf..f6e58b0 100644 --- a/handout.md +++ b/handout.md @@ -80,7 +80,7 @@ If you want to practice more feel free to keep practicising making changes to yo To practice using Git, Github pages and Markdown we can contribute to a Github pages site. This page is currently very bare but we can change that by making some pull requests and suggesting changes. #### pull-request (slightly easier way) -1. Navigate to the repo. +1. Navigate to the https://github.com/davanstrien/week-three-library-carpentry 2. Click on 'fork' repository. You will then be asked to choose where to 'fork' your repository. 3. Once we have our own fork we can edit files directly from the github site. This is a good chance to practice some markdown syntax. You can preview how it will look before you commit changes.NB this is 'github' flavour of markdown, there are slight differences between different 'flavours'. 4. Once we have done this we can commit our changes. From 22abdef90a3b20d8d34022f5e1ab65f3764c9639 Mon Sep 17 00:00:00 2001 From: Daniel van Strien Date: Fri, 20 Nov 2015 09:35:27 +0000 Subject: [PATCH 36/56] Create further_reading.md --- further_reading.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 further_reading.md diff --git a/further_reading.md b/further_reading.md new file mode 100644 index 0000000..6c8d29d --- /dev/null +++ b/further_reading.md @@ -0,0 +1,4 @@ +* The help pages of github are a good place to start: https://help.github.com/ +* Github has 'activities' which aim to explain how git works: https://guides.github.com/activities/hello-world/ +* Some indepth but clear tutorials on using git. https://www.atlassian.com/git/tutorials +* A website aimed at historians but useful for librarians/those interested in Digital Humanities. The project uses Github and a programme called Jekyll to manage new lessons/the website. A useful place to see a non coding use of github in action: programminghistorian.org From 70208b2e073db2039847972572d1013b5a0254a9 Mon Sep 17 00:00:00 2001 From: drjwbaker Date: Fri, 20 Nov 2015 13:35:49 +0000 Subject: [PATCH 37/56] lesson merge --- Git_lesson.md | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 55af4b9..37454db 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -1,4 +1,4 @@ -## Library Carpetry. Week Three: Git +## Library Carpentry. Week Three: Git **Notes: set up website before hand** @@ -30,7 +30,7 @@ Git is a 'free and open source distributed version control system'. We probably know what free and open source means but we might be less sure about what a 'distributed version control system is'. One way to understand what Git and version control systems do is to look at the types of problems they are built to address. -![PhD comics](http://www.phdcomics.com/comics/archive/phd101212s.gif) + Many of us will have had an experience similar to this. We are working on an important piece of work and we attempt to maintain multiple version of this document in different stages of completeness. @@ -40,7 +40,7 @@ Version control allow us to take this one step further and not only record chang When we make 'commits' we record a range of metadata about that change. As librarians we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date of when a commit was made. Although we can often see inforamtion about when we last edited or saved a document this only shows us the most recent changes. When we make commits we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. -### Git vs. Github vs. Gitlab +### Git vs. Github vs. Gitlab We often hear the terms Git and Github used interchangeably but the are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems like mercurial and SVN). Github is a popular site which hosts git repositories. The majority of the content that Github hosts is open source software though increasingly it is being used for other projects such as open access journals and constantly updated text books. Github is a great place to learn how to use Git but once you have learned the ideas and processes behind github you can used Git on other storage systems or host repositories on your own server if you wanted to keep code private or you wanted to encrypt your repository. @@ -98,6 +98,7 @@ Untracked files: nothing added to commit but untracked files present (use "git add" to track) ~~~ + This status is git telling us that it has noticed a new file in our directory that we currently aren't tracking. To change this and to tell git we want to track changes we make to git_test.txt we can use **git add** @@ -105,7 +106,9 @@ To change this and to tell git we want to track changes we make to git_test.txt ~~~ $ git add git_test.txt ~~~ + This adds our txt file to the **staging area** (the area where git checks for file changes). Because we can't see that this has happened we might want to use **`git status`** again. + ~~~ $ git status On branch master @@ -121,10 +124,13 @@ Changes to be committed: We can see that the file has changed colour and git also tells us that it has got a new file. Lets make some changes to this file before we commit + ~~~ $ open git_test.txt ~~~ + We should now be able to add some text to our text file. For now lets just write 'hello world'. If we try **git status** again. We should get the following message + ~~~ Changes not staged for commit: (use "git add ..." to update what will be committed) @@ -132,17 +138,22 @@ Changes not staged for commit: modified: git_test.txt ~~~ + This lets us know that Git has spotted changes to our txt file but that it hasn't yet 'staged them'. This means git won't currently record the changes we made. We can add the file to the staging area again + ~~~ git add git_test.txt ~~~ + We can now **commit** our first changes. Commit is similar to 'saving' a file to git. However compared to saving a lot more information about the changes we made is recorded and visible to us later. + ~~~ git commit -m 'hello world' [master (root-commit) 27c3f19] hello world 1 file changed, 1 insertion(+) create mode 100644 git_test.txt ~~~ + We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment if we wanted to work with someone else they would have no way of seeing what we've done. Lets fix that. Lets jump to the github website where we could decide to host some of work. Hosting here will allow us to share our work with friend and collegues but also allow other people to use or build on our work. *** @@ -177,6 +188,7 @@ This is letting us know where we are working (the master branch). We can also se We can use **git diff** to see changes we have made before making a commit. Lets add another line to our text file. + ~~~ $ open git_test.txt $ git diff @@ -199,7 +211,8 @@ We can see the changes we have made. 3. The third and fourth lines once again show the name of the file being changed. 4. The remaining lines are the most interesting, they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. -We can now commit these changes again +We can now commmit these changes again + ~~~ $ git add git_test.txt $ git commit -m 'second line of changes' @@ -239,6 +252,7 @@ $ git push now if we go back to our github repo we can see all our changes. Lets add an extra line of text and commit these changes. When we commit changes on github itself we don't have to push these. Now lets get the third line onto our computer. + ~~~ $ git pull remote: Counting objects: 3, done. @@ -254,9 +268,11 @@ Fast-forward ~~~ If we open our text file again + ~~~ $ open git_test.txt ~~~ + we can see our new lines. When we begin collobarating on more complex projects we may have to consider more aspects of git functionality but this should be a good start. In the second hour we can look more closely at collobarating and using github pages. From f3d08b9a564f97b4218a21b629976c5455594fe8 Mon Sep 17 00:00:00 2001 From: drjwbaker Date: Fri, 20 Nov 2015 13:43:20 +0000 Subject: [PATCH 38/56] pandoc docx with edits to get in under 2 pages --- handout.docx | Bin 0 -> 9947 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 handout.docx diff --git a/handout.docx b/handout.docx new file mode 100644 index 0000000000000000000000000000000000000000..cc926bf4b42e307b18b59dbe1679732c81f756d9 GIT binary patch literal 9947 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 Date: Mon, 9 May 2016 00:20:27 -0700 Subject: [PATCH 39/56] Initial commit --- README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..c83211d --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# library-git \ No newline at end of file From 829ebb5cb09517c3fa9d5600e8bdbeded77927ad Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Thu, 2 Jun 2016 15:46:33 +1000 Subject: [PATCH 40/56] Update Git_lesson.md Initial reword of intro --- Git_lesson.md | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 37454db..980781e 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -1,4 +1,4 @@ -## Library Carpentry. Week Three: Git +## Library Carpentry. Module Three: Git **Notes: set up website before hand** @@ -8,20 +8,20 @@ ### Intro -#### what we will try and do -**begin** to understand and use Git/Github. You will not be an expert by the end of the evening. You will probably not even feel very comfortable using Git. This is okay. We want to make a start but like any skill using Git takes practice. +#### what we will try to do +**begin** to understand and use Git/Github. You will not be an expert by the end of the class. You will probably not even feel very comfortable using Git. This is okay. We want to make a start but, like any skill, using Git takes practice. #### be excellent to each other -* If you spot someone that is struggling with something and you think you know how to help give them a hand. Try not to do it for them but explain the steps they need to take and *what* these steps are doing. +* If you spot someone who is struggling with something and you think you know how to help, please give them a hand. Try not to do the task for them: instead explain the steps they need to take and *what* these steps will achieve. #### be patient with me and yourself * This is a big group, with different levels of knowledge, different computer systems. * This isn't my full-time job (though if someone wants to pay me to play with computers all day I'd probably accept). I'll do my best to make this session useful. -* This is your session. If you feel we are going to fast then let me know. We can decide as a group what to cover. +* This is your session. If you feel we are going too fast, then please put up a pink sticky. We can decide as a group what to cover. ### Hour One -- What is Git. What is GitHub. Basic language. Doin g the basics. +- What is Git. What is GitHub. Basic language. Doing the basics. - *Lesson based on Software Carpentry, [Version Control with Git](https://github.com/swcarpentry/git-novice) ([Creative Commons Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/))* - the problem? loose changes, collaboration, different versions? - solution: Version control? @@ -32,13 +32,15 @@ Git is a 'free and open source distributed version control system'. We probably -Many of us will have had an experience similar to this. We are working on an important piece of work and we attempt to maintain multiple version of this document in different stages of completeness. +Many of us will have had an experience similar to this. We are working on an important piece of work and we attempt to maintain multiple versions of this document, all at different stages of completeness. -Version control addresses this problem by recording the changes we make to a document as we proceed. Each of the 'commits' we make is recorded and we can go back across a document or a set of documents and look at what changes have been made. +Version control addresses this problem by recording the changes made to a file as we proceed. Each 'commit' we make is recorded and we can go back across a file or set of files and look at what changes have been made. -Version control allow us to take this one step further and not only record changes to a document one person is working on but allows multiple people to work on a document and record the changes they make. It is then possible to merge these multiple documents. This developed out of a need for groups writing code together to be able to work on coding projects together without having to wait for someone else to finish working on something or having to manually compare changes that are made. +Version control allow us to take this one step further. It not only records changes to a file one person is working on but allows multiple people to work on a file and record the changes *they* make. It is then possible to merge these multiple files into one. -When we make 'commits' we record a range of metadata about that change. As librarians we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date of when a commit was made. Although we can often see inforamtion about when we last edited or saved a document this only shows us the most recent changes. When we make commits we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. +This method came about to help software developers work collaboratively on coding projects. With version control, groups did not have to wait for someone else to finish working, nor did they have compare changes manually (and laboriously). + +When we make 'commits', we record a range of metadata about that change. As librarians, we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date a commit was made. Although we can often see information about when we last edited or saved say, a Word document, this only shows us the most recent changes. When we make commits, we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. ### Git vs. Github vs. Gitlab From c405f14648466f79e68707476212f89b1a865016 Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Thu, 2 Jun 2016 16:16:48 +1000 Subject: [PATCH 41/56] Update Git_lesson.md Changing text of lesson in the first hour --- Git_lesson.md | 64 +++++++++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 980781e..83fea37 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -4,7 +4,7 @@ ### Self-reporting -(James) In addition to the skill level self-reporting you've been doing, now we've hit the half way point of Library Carpentry we'd like to know if you are feeling able to articulate ways in which what we've learnt thus far could be used in your daily practice. So for the next two minutes, please write *briefly* on a sticky note a scenario in which you imagine - that is, not necessarily right now but with a little practice - you or your team will be able to use what you've learnt thus far at work, in your libraries. And if you can't see an application, then tell us that! +In addition to the skill level self-reporting you've been doing, now we've hit the half way point of Library Carpentry we'd like to know if you are feeling able to articulate ways in which what we've learnt thus far could be used in your daily practice. So for the next two minutes, please write *briefly* on a sticky note a scenario in which you imagine - that is, not necessarily right now but with a little practice - you or your team will be able to use what you've learnt thus far at work, in your libraries. And if you can't see an application, then tell us that! ### Intro @@ -42,12 +42,12 @@ This method came about to help software developers work collaboratively on codin When we make 'commits', we record a range of metadata about that change. As librarians, we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date a commit was made. Although we can often see information about when we last edited or saved say, a Word document, this only shows us the most recent changes. When we make commits, we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. -### Git vs. Github vs. Gitlab +### Git vs. GitHub vs. Gitlab -We often hear the terms Git and Github used interchangeably but the are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems like mercurial and SVN). Github is a popular site which hosts git repositories. The majority of the content that Github hosts is open source software though increasingly it is being used for other projects such as open access journals and constantly updated text books. Github is a great place to learn how to use Git but once you have learned the ideas and processes behind github you can used Git on other storage systems or host repositories on your own server if you wanted to keep code private or you wanted to encrypt your repository. +We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. ### Using Git -One of the main barriers to getting started with git is the language. Although some of the language used in Git is fairly self explanatory other terms are not so clear. The best way to get to learn Git language is to begin using it but having an overview of the language and way Git is used will provide a good starting point. +One of the main barriers to getting started with Git is the language. Although some of the language used in Git is fairly self explanatory, other terms are not so clear. The best way to get to learn Git language is by using it but having an overview of the language and the way Git is used will provide a good starting point. @@ -57,9 +57,9 @@ One of the main barriers to getting started with git is the language. Although s **init** Create a repository -Whenever we use Git on the commnand line we begin our command with Git. This is so the computer knows we are trying to get Git to do something rather than another programme. +Whenever we use Git on the commnand line we begin our command with Git. This is so the computer knows we are trying to get Git to do something rather than another program. -To try out some of the git commands we can make a repository for todays session. We can either delete this directory later or keep it as a place to test out new git commands. +To try out some of the Git commands, we can make a repository for today's session. We can either delete this directory later or keep it as a place to test out new Git commands. We covered the command line last week but we will go over them again. @@ -80,14 +80,14 @@ $ nothing to commit (create/copy files and use "git add" to track) ~~~ This is telling us that we are on the master branch (more on this later) and that we have nothing to commit (nothing to save changes from). -If we use list directory we can see currently we don't have any files to track. Lets change that an add a txt file. +If we use list directory we can see currently we don't have any files to track. Let's change that by adding a txt file. Touch allows us to create an empty file. ~~~ $ ls $ touch git_test.txt ~~~ -We now have a txt file. If we try git status again we will get the following +We now have a txt file. If we try git status again, we will get the following ~~~ $ git status @@ -101,15 +101,15 @@ Untracked files: nothing added to commit but untracked files present (use "git add" to track) ~~~ -This status is git telling us that it has noticed a new file in our directory that we currently aren't tracking. +This status is Git telling us that it has noticed a new file in our directory that we currently aren't tracking. -To change this and to tell git we want to track changes we make to git_test.txt we can use **git add** +To change this, and to tell Git we want to track any changes we make to git_test.txt, we use **git add** ~~~ $ git add git_test.txt ~~~ -This adds our txt file to the **staging area** (the area where git checks for file changes). Because we can't see that this has happened we might want to use **`git status`** again. +This adds our txt file to the **staging area** (the area where git checks for file changes). Because we are not alerted that this has happened, we might want to use **`git status`** again. ~~~ $ git status @@ -123,15 +123,15 @@ Changes to be committed: new file: git_test.txt ~~~ -We can see that the file has changed colour and git also tells us that it has got a new file. +We can see that the file has changed colour (generally from red to green) and Git also tells us that it has got a new file. -Lets make some changes to this file before we commit +Let's make some changes to this file before we commit it: ~~~ -$ open git_test.txt +$ nano git_test.txt ~~~ -We should now be able to add some text to our text file. For now lets just write 'hello world'. If we try **git status** again. We should get the following message +We should now be able to add some text to our text file. For now let's just write 'hello world'. If we try **git status** again. We should get the following message ~~~ Changes not staged for commit: @@ -141,13 +141,13 @@ Changes not staged for commit: modified: git_test.txt ~~~ -This lets us know that Git has spotted changes to our txt file but that it hasn't yet 'staged them'. This means git won't currently record the changes we made. We can add the file to the staging area again +This lets us know that Git has spotted changes to our txt file but that it hasn't yet 'staged' them. This means Git won't currently record the changes we made. We can add the file to the staging area again ~~~ git add git_test.txt ~~~ -We can now **commit** our first changes. Commit is similar to 'saving' a file to git. However compared to saving a lot more information about the changes we made is recorded and visible to us later. +We can now **commit** our first changes. Commit is similar to 'saving' a file to Git. However compared to saving, a lot more information about the changes we made is recorded and visible to us later. ~~~ git commit -m 'hello world' @@ -156,11 +156,11 @@ git commit -m 'hello world' create mode 100644 git_test.txt ~~~ -We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment if we wanted to work with someone else they would have no way of seeing what we've done. Lets fix that. Lets jump to the github website where we could decide to host some of work. Hosting here will allow us to share our work with friend and collegues but also allow other people to use or build on our work. +We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. *** -When we have logged in to github we will see an option to create a new repository. Lets make one for the github experiments we are going to do today. +When we have logged in to GitHub, we will see an option to create a new repository. Let's make one for the GitHub experiments we are going to do today. * new repository * give it a name @@ -171,14 +171,14 @@ once we have made our repository we still need to link the repository we have on $ git remote add origin ~~~ -This will add a repository on github for our changes to be commited to. +This will add a repository on github for our changes to be committed to. ~~~ $ git push -u origin master ~~~ **git push** will add changes to our repository. The name of our remote is origin and the default local branch name is master. The -u tells Git to remember the parameters, so that next time we can simply run git push and Git will know what to do. Go ahead and push it! -When we type this command we will see git 'pushing' changes to github. Because our file is very small this won't take long but if we have made a lot of changes or are adding a very large repository we may have to wait a little longer. +When we type this command, we will see Git 'pushing' changes to github. Because our file is very small, this won't take long but if we had made a lot of changes or are adding a very large repository we might have to wait a little longer. We can get to see where we're at with **git status** ~~~ On branch master @@ -189,7 +189,7 @@ nothing to commit, working directory clean This is letting us know where we are working (the master branch). We can also see that we have no changes to commit and everything is in order. We can use **git diff** to see changes we have made before making a commit. -Lets add another line to our text file. +Let's add another line to our text file. ~~~ $ open git_test.txt @@ -210,8 +210,8 @@ We can see the changes we have made. 1. The first line tells us that Git is producing output similar to the Unix diff command comparing the old and new versions of the file. 2. The second line tells exactly which versions of the file Git is comparing; df0654a and 315bf3a are unique computer-generated labels for those versions. -3. The third and fourth lines once again show the name of the file being changed. -4. The remaining lines are the most interesting, they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. +3. The third and fourth lines once again show the name of the file being changed. +4. The remaining lines are the most interesting; they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. We can now commmit these changes again @@ -237,23 +237,23 @@ Date: Sun Oct 18 13:27:31 2015 +0100 hello world ~~~ -This shows us the two commits we have made and shows the messages we wrote. It is important that we try and use meangiful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. +This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meangiful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. -We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that it is worth learning one more command. **git pull** +We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that, it is worth learning one more command. **git pull** -We can try and see how this works by making changes on the github website and then 'pulling' them onto our computer. +We can try to see how this works by making changes on the GitHub website and then 'pulling' them on to our computer. -Lets go to our respository. We can see our txt file and make changes. However, you may have noticed only our first change is there. This is because we didn't push our last commit yet. This might seem like a mistake in design but it is often useful to make a lot of commits for small changes so you are able to make careful revisions later and you don't necessarily want to push all these changes one by one. +Let's go to our respository. We can see our txt file and make changes. However, you may have noticed only our first change is there. This is because we didn't push our last commit yet. This might seem like a mistake in design but it is often useful to make a lot of commits for small changes so you are able to make careful revisions later and you don't necessarily want to push all these changes one by one. -Lets go back and push our changes +Let's go back and push our changes ~~~ $ git push ~~~ -now if we go back to our github repo we can see all our changes. Lets add an extra line of text and commit these changes. When we commit changes on github itself we don't have to push these. +now if we go back to our github repo we can see all our changes. Let's add an extra line of text and commit these changes. When we commit changes on GitHub itself we don't have to push these. -Now lets get the third line onto our computer. +Now let's get the third line on to our computer. ~~~ $ git pull @@ -277,7 +277,7 @@ $ open git_test.txt we can see our new lines. -When we begin collobarating on more complex projects we may have to consider more aspects of git functionality but this should be a good start. In the second hour we can look more closely at collobarating and using github pages. +When we begin collaborating on more complex projects, we may have to consider more aspects of git functionality, but this should be a good start. In the second hour we can look more closely at collaborrating and using GitHub pages. --- From f4fdafeeb2d186c1f3af073441eb515ec8078bda Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Thu, 2 Jun 2016 17:28:10 +1000 Subject: [PATCH 42/56] Update Git_lesson.md minor fixes that I now don't remember - it's been a long day! --- Git_lesson.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index 83fea37..d67325b 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -57,7 +57,7 @@ One of the main barriers to getting started with Git is the language. Although s **init** Create a repository -Whenever we use Git on the commnand line we begin our command with Git. This is so the computer knows we are trying to get Git to do something rather than another program. +Whenever we use Git on the command line, we need to preface our command with Git. This is so the computer knows we are trying to get Git to do something rather than another program. To try out some of the Git commands, we can make a repository for today's session. We can either delete this directory later or keep it as a place to test out new Git commands. From 8ae02bd1d44fd4a2dd6591cee76a219d8b30df09 Mon Sep 17 00:00:00 2001 From: VictorE87 Date: Thu, 2 Jun 2016 14:27:48 +0200 Subject: [PATCH 43/56] Update Git_lesson.md fixes #3 --- Git_lesson.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index d67325b..d050536 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -156,7 +156,7 @@ git commit -m 'hello world' create mode 100644 git_test.txt ~~~ -We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. +We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem now though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. *** @@ -237,7 +237,7 @@ Date: Sun Oct 18 13:27:31 2015 +0100 hello world ~~~ -This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meangiful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. +This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meaningful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that, it is worth learning one more command. **git pull** From 2a0e26741bf6114db08c4dbe4222a7019997bcf6 Mon Sep 17 00:00:00 2001 From: Mateusz Kuzak Date: Thu, 2 Jun 2016 14:36:05 +0200 Subject: [PATCH 44/56] Add more explanation in section about Git and Github fixes #5 --- Git_lesson.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index d050536..5795a97 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -44,7 +44,7 @@ When we make 'commits', we record a range of metadata about that change. As libr ### Git vs. GitHub vs. Gitlab -We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. +We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control system, also called VCS in short (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. Gitlab is an opensource git repository management and hosting software. You can host it on your own server and configure with unlimited private repositories. ### Using Git One of the main barriers to getting started with Git is the language. Although some of the language used in Git is fairly self explanatory, other terms are not so clear. The best way to get to learn Git language is by using it but having an overview of the language and the way Git is used will provide a good starting point. @@ -156,7 +156,7 @@ git commit -m 'hello world' create mode 100644 git_test.txt ~~~ -We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem now though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. +We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. *** @@ -237,7 +237,7 @@ Date: Sun Oct 18 13:27:31 2015 +0100 hello world ~~~ -This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meaningful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. +This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meangiful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that, it is worth learning one more command. **git pull** From 0b56dae3ddf4c9405fdf01909ffe44d3dd079070 Mon Sep 17 00:00:00 2001 From: Mateusz Kuzak Date: Thu, 2 Jun 2016 14:55:27 +0200 Subject: [PATCH 45/56] Add a comment on not creatig README fixes #5 --- Git_lesson.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index 5795a97..191d73d 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -165,7 +165,8 @@ When we have logged in to GitHub, we will see an option to create a new reposito * new repository * give it a name -once we have made our repository we still need to link the repository we have on our computer and the one we've just made. +Github will ask you to create README.md and add a license. Do not do it for now. +Once we have made our repository we still need to link the repository we have on our computer and the one we've just made. ~~~ $ git remote add origin From 9bb543b324e9545926b1ac44ec0886cc16d417fc Mon Sep 17 00:00:00 2001 From: Mateusz Kuzak Date: Thu, 2 Jun 2016 16:09:26 +0200 Subject: [PATCH 46/56] Fix hyperlink to phd comic fixes #1 --- Git_lesson.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index 191d73d..03a56cc 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -30,7 +30,7 @@ In addition to the skill level self-reporting you've been doing, now we've hit t Git is a 'free and open source distributed version control system'. We probably know what free and open source means but we might be less sure about what a 'distributed version control system is'. One way to understand what Git and version control systems do is to look at the types of problems they are built to address. - +[PhD comics](http://www.phdcomics.com/comics/archive/phd101212s.gif) Many of us will have had an experience similar to this. We are working on an important piece of work and we attempt to maintain multiple versions of this document, all at different stages of completeness. From aa5e7005584fc5e3752bacc2b2c0083d88de6cb3 Mon Sep 17 00:00:00 2001 From: Mateusz Kuzak Date: Thu, 2 Jun 2016 16:24:40 +0200 Subject: [PATCH 47/56] Used notepad++ on windows fixes #2 --- Git_lesson.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Git_lesson.md b/Git_lesson.md index 03a56cc..0a84753 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -126,10 +126,11 @@ Changes to be committed: We can see that the file has changed colour (generally from red to green) and Git also tells us that it has got a new file. Let's make some changes to this file before we commit it: - +If you are on Linux or Mac use nano. ~~~ $ nano git_test.txt ~~~ +On Windows open the file in Notepad++. We should now be able to add some text to our text file. For now let's just write 'hello world'. If we try **git status** again. We should get the following message From 22e77573e9dae42158379d254bf7839bffff8f60 Mon Sep 17 00:00:00 2001 From: Mateusz Kuzak Date: Thu, 2 Jun 2016 16:37:28 +0200 Subject: [PATCH 48/56] Fix some typos --- Git_lesson.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 0a84753..e18abf8 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -44,10 +44,10 @@ When we make 'commits', we record a range of metadata about that change. As libr ### Git vs. GitHub vs. Gitlab -We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control system, also called VCS in short (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. Gitlab is an opensource git repository management and hosting software. You can host it on your own server and configure with unlimited private repositories. +We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control system, also called VCS in short (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. Gitlab is an open source git repository management and hosting software. You can host it on your own server and configure with unlimited private repositories. ### Using Git -One of the main barriers to getting started with Git is the language. Although some of the language used in Git is fairly self explanatory, other terms are not so clear. The best way to get to learn Git language is by using it but having an overview of the language and the way Git is used will provide a good starting point. +One of the main barriers to getting started with Git is the language. Although some of the language used in Git is fairly self-explanatory, other terms are not so clear. The best way to get to learn Git language is by using it but having an overview of the language and the way Git is used will provide a good starting point. @@ -157,7 +157,7 @@ git commit -m 'hello world' create mode 100644 git_test.txt ~~~ -We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem know though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. +We can see that one file changed and we made one insertion which was our 'hello world'. We have now recorded our changes and we can later go back and see when we made changes to our file and decided to add 'hello world'. We do have a problem now though. At the moment our changes are only recorded on our computer. At the moment, if we wanted to work with someone else, they would have no way of seeing what we've done. Let's fix that. Let's jump to the GitHub website where we could decide to host some of work. Hosting here will allow us to share our work with our friend and collegues but will also allow other people to use or build on our work. *** @@ -215,7 +215,7 @@ We can see the changes we have made. 3. The third and fourth lines once again show the name of the file being changed. 4. The remaining lines are the most interesting; they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. -We can now commmit these changes again +We can now commit these changes again ~~~ $ git add git_test.txt @@ -239,13 +239,13 @@ Date: Sun Oct 18 13:27:31 2015 +0100 hello world ~~~ -This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meangiful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. +This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meaningful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that, it is worth learning one more command. **git pull** We can try to see how this works by making changes on the GitHub website and then 'pulling' them on to our computer. -Let's go to our respository. We can see our txt file and make changes. However, you may have noticed only our first change is there. This is because we didn't push our last commit yet. This might seem like a mistake in design but it is often useful to make a lot of commits for small changes so you are able to make careful revisions later and you don't necessarily want to push all these changes one by one. +Let's go to our repository. We can see our txt file and make changes. However, you may have noticed only our first change is there. This is because we didn't push our last commit yet. This might seem like a mistake in design but it is often useful to make a lot of commits for small changes so you are able to make careful revisions later and you don't necessarily want to push all these changes one by one. Let's go back and push our changes @@ -279,7 +279,7 @@ $ open git_test.txt we can see our new lines. -When we begin collaborating on more complex projects, we may have to consider more aspects of git functionality, but this should be a good start. In the second hour we can look more closely at collaborrating and using GitHub pages. +When we begin collaborating on more complex projects, we may have to consider more aspects of git functionality, but this should be a good start. In the second hour we can look more closely at collaborating and using GitHub pages. --- @@ -318,7 +318,7 @@ Github pages allow you to version control your website. This is useful for a lot Github pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need fixing), list things to do in the future and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. ### Setting up a Github page -Now we're all persuaded of how awesome Github pages are (or you've identfied some fatal flaws in my reasoning) it would be useful to try playing around with some things we can do with Github pages. This will help us cement what we have learned in the previous hour and may help spark discussion for the last section of this session. +Now we're all persuaded of how awesome Github pages are (or you've identified some fatal flaws in my reasoning) it would be useful to try playing around with some things we can do with Github pages. This will help us cement what we have learned in the previous hour and may help spark discussion for the last section of this session. Suggestion for second hour. Use github page generator to set up a github page site. From 26f0d3459bc7c445eff1fdef27673c9d9bd557a0 Mon Sep 17 00:00:00 2001 From: Mateusz Kuzak Date: Thu, 2 Jun 2016 17:12:42 +0200 Subject: [PATCH 49/56] Write Github and GitHub --- Git_lesson.md | 66 ++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index e18abf8..db19f66 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -44,20 +44,20 @@ When we make 'commits', we record a range of metadata about that change. As libr ### Git vs. GitHub vs. Gitlab -We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control system, also called VCS in short (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. Gitlab is an open source git repository management and hosting software. You can host it on your own server and configure with unlimited private repositories. +We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control system, also called VCS in short (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts Git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. Gitlab is an open source Git repository management and hosting software. You can host it on your own server and configure with unlimited private repositories. ### Using Git One of the main barriers to getting started with Git is the language. Although some of the language used in Git is fairly self-explanatory, other terms are not so clear. The best way to get to learn Git language is by using it but having an overview of the language and the way Git is used will provide a good starting point. - + ### Some Git commands/language - what they mean and how to use them -**Repository** A repository is the place where are projects and associated changes are stored. Repositories can contain one single readme file or hundreds of different folders making up the source code for extensive projects. We can create repositories in a number of different ways; we can make our own from scratch, we can fork (copy) an existing repository or we can create a git repository from an existing folder we have been working on. +**Repository** A repository is the place where are projects and associated changes are stored. Repositories can contain one single readme file or hundreds of different folders making up the source code for extensive projects. We can create repositories in a number of different ways; we can make our own from scratch, we can fork (copy) an existing repository or we can create a Git repository from an existing folder we have been working on. **init** Create a repository -Whenever we use Git on the command line, we need to preface our command with Git. This is so the computer knows we are trying to get Git to do something rather than another program. +Whenever we use Git on the command line, we need to preface our command with `git`. This is so the computer knows we are trying to get Git to do something rather than another program. To try out some of the Git commands, we can make a repository for today's session. We can either delete this directory later or keep it as a place to test out new Git commands. @@ -69,8 +69,8 @@ $ cd git_test $ git init ~~~ -**git status** -we can use git status at any time to let us know what git is up to. +**Git status** +we can use `git status` at any time to let us know what git is up to. if we try it now we should get something like this ~~~ @@ -87,7 +87,7 @@ $ ls $ touch git_test.txt ~~~ -We now have a txt file. If we try git status again, we will get the following +We now have a txt file. If we try `git status` again, we will get the following ~~~ $ git status @@ -103,13 +103,13 @@ nothing added to commit but untracked files present (use "git add" to track) This status is Git telling us that it has noticed a new file in our directory that we currently aren't tracking. -To change this, and to tell Git we want to track any changes we make to git_test.txt, we use **git add** +To change this, and to tell Git we want to track any changes we make to git_test.txt, we use `git add` ~~~ $ git add git_test.txt ~~~ -This adds our txt file to the **staging area** (the area where git checks for file changes). Because we are not alerted that this has happened, we might want to use **`git status`** again. +This adds our txt file to the **staging area** (the area where Git checks for file changes). Because we are not alerted that this has happened, we might want to use `git status` again. ~~~ $ git status @@ -132,7 +132,7 @@ $ nano git_test.txt ~~~ On Windows open the file in Notepad++. -We should now be able to add some text to our text file. For now let's just write 'hello world'. If we try **git status** again. We should get the following message +We should now be able to add some text to our text file. For now let's just write 'hello world'. If we try `git status` again. We should get the following message ~~~ Changes not staged for commit: @@ -166,7 +166,7 @@ When we have logged in to GitHub, we will see an option to create a new reposito * new repository * give it a name -Github will ask you to create README.md and add a license. Do not do it for now. +GitHub will ask you to create README.md and add a license. Do not do it for now. Once we have made our repository we still need to link the repository we have on our computer and the one we've just made. ~~~ @@ -178,10 +178,10 @@ This will add a repository on github for our changes to be committed to. $ git push -u origin master ~~~ -**git push** will add changes to our repository. The name of our remote is origin and the default local branch name is master. The -u tells Git to remember the parameters, so that next time we can simply run git push and Git will know what to do. Go ahead and push it! +**git push** will add changes to our repository. The name of our remote is origin and the default local branch name is master. The -u tells Git to remember the parameters, so that next time we can simply run `git push` and Git will know what to do. Go ahead and push it! -When we type this command, we will see Git 'pushing' changes to github. Because our file is very small, this won't take long but if we had made a lot of changes or are adding a very large repository we might have to wait a little longer. -We can get to see where we're at with **git status** +When we type this command, we will see Git 'pushing' changes to GitHub. Because our file is very small, this won't take long but if we had made a lot of changes or are adding a very large repository we might have to wait a little longer. +We can get to see where we're at with `git status`. ~~~ On branch master Your branch is up-to-date with 'origin/master'. @@ -190,7 +190,7 @@ nothing to commit, working directory clean ~~~ This is letting us know where we are working (the master branch). We can also see that we have no changes to commit and everything is in order. -We can use **git diff** to see changes we have made before making a commit. +We can use `git diff` to see changes we have made before making a commit. Let's add another line to our text file. ~~~ @@ -211,7 +211,7 @@ index 70c379b..1d55e1a 100644 We can see the changes we have made. 1. The first line tells us that Git is producing output similar to the Unix diff command comparing the old and new versions of the file. -2. The second line tells exactly which versions of the file Git is comparing; df0654a and 315bf3a are unique computer-generated labels for those versions. +2. The second line tells exactly which versions of the file Git is comparing; `df0654a` and `315bf3a` are unique computer-generated labels for those versions. 3. The third and fourth lines once again show the name of the file being changed. 4. The remaining lines are the most interesting; they show us the actual differences and the lines on which they occur. In particular, the + markers in the first column show where we have added lines. @@ -222,7 +222,7 @@ $ git add git_test.txt $ git commit -m 'second line of changes' ~~~ -Say we are very forgetful and have already forgotten what we changes we have made. **git log** allows us to look at what we have been doing to our git repository. +Say we are very forgetful and have already forgotten what we changes we have made. `git log` allows us to look at what we have been doing to our Git repository. ~~~ $ git status @@ -241,7 +241,9 @@ Date: Sun Oct 18 13:27:31 2015 +0100 This shows us the two commits we have made and shows the messages we wrote. It is important that we try to use meaningful commit messages when we make changes. This is especially important when we are working with other people who might not be able to guess as easily what our short cryptic messages might refer too. -We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that, it is worth learning one more command. **git pull** +We might get a lit bit lonely working away on our own and want to work with other people. Before we get to that, it is worth learning one more command. + +**git pull** We can try to see how this works by making changes on the GitHub website and then 'pulling' them on to our computer. @@ -279,7 +281,7 @@ $ open git_test.txt we can see our new lines. -When we begin collaborating on more complex projects, we may have to consider more aspects of git functionality, but this should be a good start. In the second hour we can look more closely at collaborating and using GitHub pages. +When we begin collaborating on more complex projects, we may have to consider more aspects of Git functionality, but this should be a good start. In the second hour we can look more closely at collaborating and using GitHub pages. --- @@ -289,13 +291,13 @@ Git cheat sheet handouts --- ### Hour Two -* First 20 minutes or so - reinforcing how git works. +* First 20 minutes or so - reinforcing how Git works. - Draw diagrams of things covered so far - - express language in 'non git' way. + - express language in 'non Git' way. -* Build on first hour and make pull requests to a github pages site. @davanstrien Setup before hand. site will link to some repositories useful for librarians/dh. -* examples of collobarative working on github links -* forking a github page. +* Build on first hour and make pull requests to a GitHub pages site. @davanstrien Setup before hand. site will link to some repositories useful for librarians/dh. +* examples of collobarative working on GitHub links +* forking a GitHub page. ## Lets review @@ -307,21 +309,21 @@ In groups: * try and 'draw' what different commands mean * try and come up with synonyms for what the commands are doing. -## Github Pages +## GitHub Pages -Github Pages are websites hosted on Github. They allow you to build a repository that displays as a website. Github pages uses Jekyll, a 'blog aware static site generator' to turn a site of files and folders into a website. +GitHub Pages are websites hosted on GitHub. They allow you to build a repository that displays as a website. GitHub pages uses Jekyll, a 'blog aware static site generator' to turn a site of files and folders into a website. -### Why Github pages are awesome! +### Why GitHub pages are awesome! -Github pages allow you to version control your website. This is useful for a lot different reasons. It allows you to keep a record of what changes you have made. It allows people to reference your website at a particular point in time and (if you make you're source open) to see what it was like at that particular point in time. This is very useful for academic citations. Most people have had the experience of following up a reference to a website and either getting a 404 error or seeing something completely different. Although using version on your site doesn't guarantee this won't happen it does make it easier to manage old versions of your site. +GitHub pages allow you to version control your website. This is useful for a lot different reasons. It allows you to keep a record of what changes you have made. It allows people to reference your website at a particular point in time and (if you make you're source open) to see what it was like at that particular point in time. This is very useful for academic citations. Most people have had the experience of following up a reference to a website and either getting a 404 error or seeing something completely different. Although using version on your site doesn't guarantee this won't happen it does make it easier to manage old versions of your site. -Github pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need fixing), list things to do in the future and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. +GitHub pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need fixing), list things to do in the future and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. -### Setting up a Github page -Now we're all persuaded of how awesome Github pages are (or you've identified some fatal flaws in my reasoning) it would be useful to try playing around with some things we can do with Github pages. This will help us cement what we have learned in the previous hour and may help spark discussion for the last section of this session. +### Setting up a GitHub page +Now we're all persuaded of how awesome GitHub pages are (or you've identified some fatal flaws in my reasoning) it would be useful to try playing around with some things we can do with GitHub pages. This will help us cement what we have learned in the previous hour and may help spark discussion for the last section of this session. Suggestion for second hour. -Use github page generator to set up a github page site. +Use GitHub page generator to set up a GitHub page site. * clone repo (add instructions) * add other users (perhaps start with teams of two) * in Groups make sure everyone tries committing - pulling changes to their computer From 5f637871561aceed462b6d69ceff35ccee9efc11 Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Fri, 3 Jun 2016 09:57:26 +1000 Subject: [PATCH 50/56] Update Git_lesson.md minor fixes to wording --- Git_lesson.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index db19f66..c8ec25d 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -1,6 +1,6 @@ ## Library Carpentry. Module Three: Git -**Notes: set up website before hand** +**Notes: set up website beforehand** ### Self-reporting @@ -299,25 +299,25 @@ Git cheat sheet handouts * examples of collobarative working on GitHub links * forking a GitHub page. -## Lets review +## Let's review -It is likely that some things won't have stuck from the last hour. To try and reinforce how things work we can work in groups to develop diagrams to illustrate Git functions and language. This should make carrying out more complicated aspects of Git clearer in our heads. +It is likely that some things won't have stuck from the last hour. To try to reinforce how things work we can work in groups to develop diagrams to illustrate Git functions and language. This should make carrying out more complicated aspects of Git clearer in our heads. In groups: * illustrate the concepts discussed in the first hour -* try and 'draw' what different commands mean -* try and come up with synonyms for what the commands are doing. +* try to 'draw' what different commands mean +* try to come up with synonyms for what the commands are doing. ## GitHub Pages -GitHub Pages are websites hosted on GitHub. They allow you to build a repository that displays as a website. GitHub pages uses Jekyll, a 'blog aware static site generator' to turn a site of files and folders into a website. +GitHub Pages are websites hosted on GitHub. They allow you to build a repository that displays as a website. GitHub pages uses Jekyll, a 'blog-aware static site generator' to turn a site of files and folders into a website. ### Why GitHub pages are awesome! -GitHub pages allow you to version control your website. This is useful for a lot different reasons. It allows you to keep a record of what changes you have made. It allows people to reference your website at a particular point in time and (if you make you're source open) to see what it was like at that particular point in time. This is very useful for academic citations. Most people have had the experience of following up a reference to a website and either getting a 404 error or seeing something completely different. Although using version on your site doesn't guarantee this won't happen it does make it easier to manage old versions of your site. +GitHub pages allow you to version control your website. This is useful for a lot of different reasons. It allows you to keep a record of what changes you have made. It allows people to reference your website at a particular point in time and (if you make your source open) to see what it was like at that particular point in time. This is very useful for academic citations. Most people have had the experience of following up a reference to a website and either getting a 404 error or seeing something completely different. Although using versions on your site doesn't guarantee this won't happen, it does make it easier to manage old versions of your site. -GitHub pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need fixing), list things to do in the future and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. +GitHub pages also mean that you can collaborate on a website with a lot of people without everyone having to communicate endlessly back and forwards about what changes need to be made, or have been made already. You can create 'issues' (things that need discussing or fixing), list things to do in the future, and allow other people visiting your website to quickly suggest, and help implement changes through pull requests. ### Setting up a GitHub page Now we're all persuaded of how awesome GitHub pages are (or you've identified some fatal flaws in my reasoning) it would be useful to try playing around with some things we can do with GitHub pages. This will help us cement what we have learned in the previous hour and may help spark discussion for the last section of this session. @@ -327,7 +327,7 @@ Use GitHub page generator to set up a GitHub page site. * clone repo (add instructions) * add other users (perhaps start with teams of two) * in Groups make sure everyone tries committing - pulling changes to their computer -* demonstrate how pull requests can be discussed. +* demonstrate how pull requests can be discussed * guidelines handout * step by step @@ -337,11 +337,11 @@ Use GitHub page generator to set up a GitHub page site. user contribution to collections? - editing of resources? -- crowd sourcing - could be an issue? +- crowdsourcing - could be an issue? - making pull requests. - open access journals -### Install for Week Four +### Install for Module Four - [Firefox](https://www.mozilla.org/en-US/firefox/new/) - [Open Refine 2.6](http://openrefine.org/download.html) From 06c352f40e7243d323c6bac10332f7de2b9341fd Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Fri, 3 Jun 2016 10:32:48 +1000 Subject: [PATCH 51/56] Update Git_lesson.md Adding Git config --- Git_lesson.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Git_lesson.md b/Git_lesson.md index c8ec25d..36918dc 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -69,6 +69,18 @@ $ cd git_test $ git init ~~~ +This initiates `git_test` as a git repository. + +We now need to configure Git locally - this is a one-time set up, but settings can be changed at any time. +~~~ +$ git config --global user.name "Mary Citizen" +$ git config --global user.email "mary_citizen@gitmail.com" +$ git config --global color.ui "auto" +$ git config --global core.editor "nano -w" +~~~ + +Now we have set things up, and configured it locally, we can see how we are going. + **Git status** we can use `git status` at any time to let us know what git is up to. From 8be8345ecab29b719a16f38468c4c4ebc4285498 Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Fri, 3 Jun 2016 12:52:32 +1000 Subject: [PATCH 52/56] Update Git_lesson.md adding info about colourised output --- Git_lesson.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Git_lesson.md b/Git_lesson.md index 36918dc..6c3fb45 100644 --- a/Git_lesson.md +++ b/Git_lesson.md @@ -42,7 +42,7 @@ This method came about to help software developers work collaboratively on codin When we make 'commits', we record a range of metadata about that change. As librarians, we might already be inclined to think creating metadata is useful but an example of what information is recorded will illustrate why the information recorded by version control systems in particular is useful. 'Commits' record the time and date a commit was made. Although we can often see information about when we last edited or saved say, a Word document, this only shows us the most recent changes. When we make commits, we can record a message explaining what changes we have made. This makes it especially useful for collaborating. Rather than sending an email with a document with track changes and some comments, we can include all that information with the document itself. This makes it easy to get an overview of changes that have been made to a document by looking at a log of all the changes that have been made. -### Git vs. GitHub vs. Gitlab +### Git vs. GitHub We often hear the terms Git and GitHub used interchangeably but they are slightly different things. Git refers to the software and principles used for a particular flavour of version control system, also called VCS in short (there are other systems such as Mercurial and SVN). GitHub is a popular site which hosts Git repositories. The majority of the content that GitHub hosts is open source software, though increasingly it is being used for other projects such as open access journals and constantly updated text books. GitHub is a great place to learn how to use Git but once you have learned the ideas and processes behind GitHub you can use Git on other storage systems. You can even host repositories on your own server if you want to keep your files private or if you wanted to encrypt your repository. You can get private repositories on GitHub for a fee. Gitlab is an open source Git repository management and hosting software. You can host it on your own server and configure with unlimited private repositories. @@ -79,12 +79,12 @@ $ git config --global color.ui "auto" $ git config --global core.editor "nano -w" ~~~ -Now we have set things up, and configured it locally, we can see how we are going. +Now we have set the directory up as a repository, and configured it locally, we can see how we are going. **Git status** -we can use `git status` at any time to let us know what git is up to. +we can use `git status` at any time to let us know what Git is up to. -if we try it now we should get something like this +If we try it now, we should get something like this ~~~ $ On branch master $ Initial commit @@ -113,7 +113,7 @@ Untracked files: nothing added to commit but untracked files present (use "git add" to track) ~~~ -This status is Git telling us that it has noticed a new file in our directory that we currently aren't tracking. +This status is Git telling us that it has noticed a new file in our directory that we currently aren't tracking. With colourised output, the filename will appear in red. To change this, and to tell Git we want to track any changes we make to git_test.txt, we use `git add` @@ -135,14 +135,14 @@ Changes to be committed: new file: git_test.txt ~~~ -We can see that the file has changed colour (generally from red to green) and Git also tells us that it has got a new file. +If we opted for colourised output, we can see that the file has changed colour (from red to green) and Git also tells us that it has got a new file. Let's make some changes to this file before we commit it: -If you are on Linux or Mac use nano. + ~~~ $ nano git_test.txt ~~~ -On Windows open the file in Notepad++. +Open the file in nano or another text editor. We should now be able to add some text to our text file. For now let's just write 'hello world'. If we try `git status` again. We should get the following message From a9261d5e3e741a6625db124c8cb453f4ebc1fead Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Fri, 3 Jun 2016 14:43:22 +1000 Subject: [PATCH 53/56] Update handout.md Adding git log --- handout.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/handout.md b/handout.md index f6e58b0..fde5e31 100644 --- a/handout.md +++ b/handout.md @@ -1,12 +1,12 @@ --- -title: Library Carpentry Week Three Versioning Data with Git +title: Library Carpentry Module Three : Versioning Data with Git --- Schedule: -* 17:45-18:25 Git and Github -* 18:30-19:25 Github pages and Markdown -* 19:30-20:25 Practice and/or discussion +* Git and Github (45 mins) +* Github pages and Markdown (45 mins) +* Practice and/or discussion (45 mins) --- @@ -54,6 +54,8 @@ ______ **`git push`**: commits the staged snapshot to the project history. +**`git log`**: history of commits in reverse chronological order. + **`git diff`**: shows changes made to files **`git pull`**: Merges upstream changes into your local repository @@ -62,8 +64,8 @@ ______ --- -### Exercise our first git repository -We will try and do this session as a group but if prefer to go at a slower pace please follow the instructions on the week three library carpentry github page. +### Exercise for our first git repository +We will try to do this session as a group but if prefer to go at a slower pace please follow the instructions on the week three library carpentry github page. ### Exercise - visualising git From 86a91a07f7218bb9192e5c668d857526d6a5124a Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Fri, 3 Jun 2016 14:45:33 +1000 Subject: [PATCH 54/56] Update handout.md slight terminology change --- handout.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/handout.md b/handout.md index fde5e31..c3203ce 100644 --- a/handout.md +++ b/handout.md @@ -71,24 +71,24 @@ We will try to do this session as a group but if prefer to go at a slower pace p In groups work spend some time trying to illustrate some of the commands we've used with Git: -* try and express git commands in a non 'git' way -* try and visualise what commits are doing to your repository +* try to express git commands in a non 'git' way +* try to visualise what commits are doing to your repository -If you want to practice more feel free to keep practicising making changes to your file and committing the changes. If you want to explore more git commands search for some more online or follow one of the suggested links below. +If you want to practise more feel free to keep practicising making changes to your file and committing the changes. If you want to explore more git commands, search for some more online or follow one of the suggested links below. ### Exercise - contributing to a github pages site -To practice using Git, Github pages and Markdown we can contribute to a Github pages site. This page is currently very bare but we can change that by making some pull requests and suggesting changes. +To practice using Git, GitHub pages and Markdown we can contribute to a GitHub pages site. This page is currently very bare but we can change that by making some pull requests and suggesting changes. #### pull-request (slightly easier way) 1. Navigate to the https://github.com/davanstrien/week-three-library-carpentry 2. Click on 'fork' repository. You will then be asked to choose where to 'fork' your repository. -3. Once we have our own fork we can edit files directly from the github site. This is a good chance to practice some markdown syntax. You can preview how it will look before you commit changes.NB this is 'github' flavour of markdown, there are slight differences between different 'flavours'. -4. Once we have done this we can commit our changes. -5. If we've made some changes which we think would be worth adding to the original site then we can make a pull request. This slightly confusing terminology basically means you are asking the owner of the original source if they would like to add (pull) some of your changes into their version. +3. Once we have our own fork, we can edit files directly from the github site. This is a good chance to practice some markdown syntax. You can preview how it will look before you commit changes.NB this is 'github' flavour of markdown, there are slight differences between different 'flavours'. +4. Once we have done this, we can commit our changes. +5. If we've made some changes which we think would be worth adding to the original site, then we can create a pull request. This slightly confusing terminology basically means you are asking the owner of the original source if they would like to add (pull) some of your changes into their version. 6. Click on compare changes. This will show you if there are any differences between the two version you have. From here we can make a pull request. -7. When we make a pull request we have the option of explaining what the pull request relates to. It is important we try and give a short concise expanation of what it is about. +7. When we make a pull request we have the option of explaining what the pull request relates to. It is important to give a short concise expanation of what it is about. #### pull-request (slightly more complicated way) * instead of making edits on the github website you can 'clone' the repository to your local machine. From bee248b70f27af77d0af94da30091bcff4fab1c8 Mon Sep 17 00:00:00 2001 From: Belinda Weaver Date: Fri, 3 Jun 2016 15:38:55 +1000 Subject: [PATCH 55/56] Update handout.md changing links --- handout.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/handout.md b/handout.md index c3203ce..39766a9 100644 --- a/handout.md +++ b/handout.md @@ -65,11 +65,11 @@ ______ --- ### Exercise for our first git repository -We will try to do this session as a group but if prefer to go at a slower pace please follow the instructions on the week three library carpentry github page. +We will try to do this session as a group, but those who prefer to go at a slower pace can follow the instructions on the [github page](https://github.com/data-lessons/library-git). ### Exercise - visualising git -In groups work spend some time trying to illustrate some of the commands we've used with Git: +In group work, spend some time trying to illustrate some of the commands we've used with Git: * try to express git commands in a non 'git' way * try to visualise what commits are doing to your repository From 963dcc804c202914744befa5260d6a891cbf6611 Mon Sep 17 00:00:00 2001 From: James Baker Date: Thu, 14 Jul 2016 10:54:02 +0200 Subject: [PATCH 56/56] Update README.md Note master depreciation. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index f6690f9..29a2f6e 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +**NOTE: the master branch is now depreciated. The [gh-pages branch](https://github.com/data-lessons/library-git/tree/gh-pages) is the default branch for this repo** + ## Library Carpetry. Git These materials are based on Library Carpentry Week 3 by James Baker.