2. What is Git?
• Distributed Version Control system (DVC)
• Used/Developed by maintainers of Linux
Kernel (Linus Torvalds)
• Fast and Efficient Branching/Merging
• Great hosted services for offsite
repositories (e.g. github.com)
3. What is Version Control?
• Snapshots changes in a corpus of text/files
• e.g. “track revisions” in MS Word
• Allows multiple people to edit corpus
• Can be used for anything that changes over time
• Software
• CV
• Legal Documents
4. What is DVC?
• Distributed Version Control
Remote Remote Remote
Push/Pull
You
5. How do I get started?
• Initialize a Git project
• git init .
• This creates a .git folder which stores the
git index (amongst other things)
• Add something to the project
• git add .
• git commit -m “first checkin”
6. How do I track changes?
• Change your files then add them to your
change set
• git add . or git add somefile
• Check out what has happened
• git status (shows current changeset)
• git log (shows recent commits)
7. Working with others
• Add a remote host (if starting out)
• Github is free and very good
• git remote add hostname hosturl
• Push your changes
• git push hostname branchname
• You can also ‘git clone’ a remote host if it already
exists
• git pull
8. Merging/Branching
• Allows working on multiple versions in parallel
• git branch somenewbranch
• git checkout somenewbranch
• Can push/pull on each branch independently
• Finish a branch by merging back to the source branch (or
elsewhere)
• git merge somenewbranch
• N.B. this merges somenewbranch into your current
branch