systems Comparison with subversion Distributed version control Git usage Basic operations Solving conflicts Branching as a core concept Tooling Conclusion Git - the fast version control system
and other information stored as computer files A system that maintains versions of files at progressive stages of development. Every file Has a full history of changes Can be restored to any version A communication tool, like email, but with code rather than human conversation Git - the fast version control system
Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Git - the fast version control system
Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Keeps track of all old versions of files Git - the fast version control system
Maintains separate “production” versions of code that are always deployable Allows simultaneous development of different features on the same codebase Keeps track of all old versions of files Prevents work being overwritten Git - the fast version control system
a set of files under version control which may be developed at different speeds or in different ways Checkout to copy the latest version of (a file in) the repository to your working copy Commit to copy (a file in) your working copy back into the repository as a new version Merge to combine multiple changes made to different working copies of the same files in the repository Repository a (shared) database with the complete revision history of all files under version control Trunk the unique line of development that is not a branch Update to retrieve and integrate changes in the repository since the update. Working copy your local copies of the files under version control you want to edit Git - the fast version control system
of the holes found in CVS, but added nothing to its development model Subversion (SVN) More feature rich and functional Git Git - the fast version control system
and is used sparingly Conflicts frequently occur and renaming is not handled well Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Git - the fast version control system
and is used sparingly Conflicts frequently occur and renaming is not handled well Can be slow due to network latency Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Very fast since less operations involve network latency Git - the fast version control system
and is used sparingly Conflicts frequently occur and renaming is not handled well Can be slow due to network latency Can consume quite some disk space Git Distributed Branching is very easy and is a core concept Conflicts occur less frequent, renaming is properly handled Very fast since less operations involve network latency Consumes 30 times less disk space Git - the fast version control system
local copy of the repository. Users commit changes and when they want to share it, the push it to the shared repository Git - the fast version control system
git clone url origin/ master doc src … master doc src … Mirror the central server Anything the main repository can do, you can do! Git - the fast version control system
git clone url My project is tiny - git is overkill “Why would I carry a Swiss knife when I only want to open cans?” Git - the fast version control system
git clone url Tiny projects should be scalable too! “You wouldn’t use Roman digits just because you perform calculations with small numbers, now would you?” Tiny projects may grow beyond your expectations “One day you’ll desperately need that hex wrench and you’re stuck with your plain can- opener” Git - the fast version control system
$ git mv file $ svn commit $ git commit –a $ svn revert path $ git checkout path What if you screw up? # re-edit the metadata and update the tree $ git commit --amend or # toss your latest commit away without changing the working tree $ git reset HEAD^ Git - the fast version control system
url $ svn update $ git pull $ svn add file $ git add file … … What actually happens… Recursive merge strategy – create a merged reference tree of common ancestors for three-way merge fewer merge conflicts can detect and handle renames Git - the fast version control system
clone url $ svn update $ git pull $ svn add file $ git add file … … Suppose Jeff and Dan both made changes to the same line in file… CONFLICT (content): Merge conflict in file Automatic merge failed; fix conflicts and then commit the result. Uh oh…. now what? Git - the fast version control system
$ svn switch url_of_branch $ git branch name_of_branch $ git checkout name_of_branch Or create and switch to a branch based on another branch $ git checkout –b new_branch other_branch Git - the fast version control system
Work on part 2 • $ git checkout master • Fix part 1… • $ git checkout part2 • $ git merge master Part 1 is approved • $ git checkout master • $ git merge part2 • $ git branch –d part2 Feature finished You’re finished with part 1 of a new feature but you can’t continue with part 2 before part 1 is released and tested Git - the fast version control system
git checkout –b bugfixbranch SHA1_HASH Fixed bug • $ git commit –a –m “Fixed bug” • $ git push • $ git checkout master Resume work While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug Git - the fast version control system
but does the job • Acts as a reference Gitk • Comes with command-line client • UI more appealing than gitk • Functionality Git Gui • OS X port of Git Gui • Looks quite nice • Still lacks functionality GitX Git - the fast version control system
Enhanced merging strategy Performance Advanced features enable better workflow Stashing temporary work Collaboration before public commits Git - the fast version control system
GitX: http://gitx.frim.nl/ TortoiseGit: http://code.google.com/p/ tortoisegit/ Git Extensions: http://sourceforge.net/ projects/gitextensions/ JGit / EGit: http://www.eclipse.org/ egit/ Git - the fast version control system