Version control with Git

This course is based on materials by Software Carpentry

Prerequisites

In this lesson we use Git from the Unix Shell. Some previous experience with the shell is expected, but is not mandatory.

Alternatively, this course can be followed on Windows using Git Bash. All of the commands shown will work on Windows using Git Bash, with the exception of the gedit command. Gedit is a common text editor on Linux: Windows users should use the notepad command instead, and set notepad as the core editor when configuring Git.

You will need a GitHub account for the afternoon session. Please sign up for an account this morning if you do not already have an account.

Resources

Workshop slideshow

Git cheat sheet (You may want to download a copy of this for reference during this workshop)

Schedule

Setup Download files required for the lesson
09:40 1. Introduction Why use version control?
09:50 2. Tracking changes with a local repository How do I get started with Git?
Where does Git store information?
10:25 3. Looking at history and differences How do I get started with Git?
Where does Git store information?
11:10 4. Commit advice How, what, and when to commit?
What makes a good commit message?
11:20 5. Branching What is a branch?
How can I merge changes from another branch?
12:00 6. Lunch break Break
13:00 7. Undoing changes How can I discard unstaged changes?
How do I edit the last commit?
How can I undo a commit?
13:25 8. Working from multiple locations with a remote repository What is a remote repository
How can I use GitHub to work from multiple locations?
13:50 9. Collaborating with a remote repository How do I update my local repository with changes from the remote?
How can I collaborate using Git?
14:30 10. Rebasing What is rebasing?
14:55 11. Pull Requests How can I contribute to a repository to which I don’t have write access?
15:10 12. Git hints and tips How can I find help?
How can I further customise Git to suit my preferences?
15:25 13. Conclusions and further information Where can I find out more?
15:30 Finish

The actual schedule may vary slightly depending on the topics and exercises chosen by the instructor.