Your SlideShare is downloading. ×
0
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Git the fast version control system
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Git the fast version control system

1,832

Published on

This presentation is meant for those who consider switching to git as a version control system

This presentation is meant for those who consider switching to git as a version control system

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,832
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
81
Comments
0
Likes
2
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Git<br />The fast version control system<br />Jeroen Rosenberg jeroen.rosenberg@gmail.com<br />
  • 2. Table of contents<br />Short introduction to version control<br />Version control systems<br />Comparison with subversion<br />Distributed version control<br />Git usage<br />Basic operations<br />Solving conflicts<br />Branching as a core concept<br />Tooling<br />Conclusion<br />Git - the fast version control system<br />
  • 3. Version control<br />Short introduction<br />Git - the fast version control system<br />
  • 4. Version control (1)<br />The management of changes to documents, programs, and other information stored as computer files<br />A system that maintains versions of files at progressive stages of development.<br />Every file<br />Has a full history of changes<br />Can be restored to any version<br />A communication tool, like email, but with code rather than human conversation<br />Git - the fast version control system<br />
  • 5. Version control (2)<br />Benefits<br />Git - the fast version control system<br />
  • 6. Version control (2)<br />Benefits<br />Allows a team to share code<br />Git - the fast version control system<br />
  • 7. Version control (2)<br />Benefits<br />Allows a team to share code<br />Maintains separate “production” versions of code that are always deployable<br />Git - the fast version control system<br />
  • 8. Version control (2)<br />Benefits<br />Allows a team to share code<br />Maintains separate “production” versions of code that are always deployable<br />Allows simultaneous development of different features on the same codebase<br />Git - the fast version control system<br />
  • 9. Version control (2)<br />Benefits<br />Allows a team to share code<br />Maintains separate “production” versions of code that are always deployable<br />Allows simultaneous development of different features on the same codebase<br />Keeps track of all old versions of files<br />Git - the fast version control system<br />
  • 10. Version control (2)<br />Benefits<br />Allows a team to share code<br />Maintains separate “production” versions of code that are always deployable<br />Allows simultaneous development of different features on the same codebase<br />Keeps track of all old versions of files<br />Prevents work being overwritten<br />Git - the fast version control system<br />
  • 11. Glossary<br />Some commonly used terms explained before moving on<br />Git - the fast version control system<br />
  • 12. Key terms in version control<br />Branch acopy of a set of files under version control which may be developed at different speeds or in different ways<br />Checkout to copy the latest version of (a file in) the repository to your working copy<br />Commit to copy (a file in) your working copy back into the repository as a new version <br />Merge to combine multiple changes made to different working copies of the same files in the repository<br />Repository a (shared) database with the complete revision history of all files under version control<br />Trunk the unique line of development that is not a branch<br />Update to retrieve and integrate changes in the repository since the update.<br />Working copy your local copies of the files under version control you want to edit<br />Git - the fast version control system<br />
  • 13. Version control systems<br />Git - the fast version control system<br />
  • 14. Very limited and inflexible<br />Concurrent Versions System (CVS)<br />Git - the fast version control system<br />
  • 15. Very limited and inflexible<br />Concurrent Versions System (CVS)<br />Fills most of the holes found in CVS, but added nothing to its development model <br />Subversion (SVN)<br />Git - the fast version control system<br />
  • 16. Very limited and inflexible<br />Concurrent Versions System (CVS)<br />Fills most of the holes found in CVS, but added nothing to its development model <br />Subversion (SVN)<br />More feature rich and functional<br />Git<br />Git - the fast version control system<br />
  • 17. Comparison with SVN<br />Subversion<br />Git<br />Git - the fast version control system<br />
  • 18. Comparison with SVN<br />Subversion<br />Centralized<br />Git<br />Distributed<br />Git - the fast version control system<br />
  • 19. Comparison with SVN<br />Subversion<br />Centralized<br />Branching can be a pain and is used sparingly<br />Git<br />Distributed<br />Branching is very easy and is a core concept<br />Git - the fast version control system<br />
  • 20. Comparison with SVN<br />Subversion<br />Centralized<br />Branching can be a pain and is used sparingly<br />Conflicts frequently occur and renaming is not handled well<br />Git<br />Distributed<br />Branching is very easy and is a core concept<br />Conflicts occur less frequent, renaming is properly handled<br />Git - the fast version control system<br />
  • 21. Comparison with SVN<br />Subversion<br />Centralized<br />Branching can be a pain and is used sparingly<br />Conflicts frequently occur and renaming is not handled well<br />Can be slow due to network latency<br />Git<br />Distributed<br />Branching is very easy and is a core concept<br />Conflicts occur less frequent, renaming is properly handled<br />Very fast since less operations involve network latency<br />Git - the fast version control system<br />
  • 22. Comparison with SVN<br />Subversion<br />Centralized<br />Branching can be a pain and is used sparingly<br />Conflicts frequently occur and renaming is not handled well<br />Can be slow due to network latency<br />Can consume quite some disk space<br />Git<br />Distributed<br />Branching is very easy and is a core concept<br />Conflicts occur less frequent, renaming is properly handled<br />Very fast since less operations involve network latency<br />Consumes 30 times less disk space<br />Git - the fast version control system<br />
  • 23. Distributed version control <br />The new generation of version control<br />Git - the fast version control system<br />
  • 24. A basic, centralized version control system<br />Users commit changes to the central repository and a new version is born to be checked out by other users<br />Git - the fast version control system<br />
  • 25. A distributed version control system<br />Each user has a full local copy of the repository. Users commit changes and when they want to share it, the push it to the shared repository <br />Git - the fast version control system<br />
  • 26. Git usage<br />Basic operations<br />Git - the fast version control system<br />
  • 27. Tracking a project..<br />Git - the fast version control system<br />
  • 28. Tracking a project..<br />Mirror the central server<br />Anything the main repository can do, you can do!<br />Git - the fast version control system<br />
  • 29. Tracking a project..<br />My project is tiny - git is overkill<br />“Why would I carry a Swiss knife when I only want to open cans?”<br />Git - the fast version control system<br />
  • 30. Tracking a project..<br />Tiny projects should be scalable too!<br />“You wouldn’t use Roman digits just because you perform calculations with small numbers, now would you?”<br />Tiny projects may grow beyond your expectations<br />“One day you’ll desperately need that hex wrench and you’re stuck with your plain can-opener”<br />Git - the fast version control system<br />
  • 31. Tracking a project..<br />Pretty straightforwarded, huh?<br />Git - the fast version control system<br />
  • 32. Advanced committing…<br />What if you screw up?<br />#re-edit the metadata and update the tree<br />$ git commit --amend<br />or<br /># toss your latest commit away without changing the working tree<br />$ git reset HEAD^ <br />Git - the fast version control system<br />
  • 33. Solving conflicts<br />Instant merging<br />Git - the fast version control system<br />
  • 34. Closer look at pulling..<br />Git - the fast version control system<br />
  • 35. Auto-merging..<br />What actually happens…<br /># Fetch latest changes from origin<br />$ git fetch<br /># Merge fetched changes into current branch<br />$ git merge refs/heads/master<br />Git - the fast version control system<br />
  • 36. Auto-merging..<br />What actually happens…<br />Recursive merge strategy – create a merged reference tree of common ancestors for three-way merge <br /><ul><li> fewer merge conflicts
  • 37. can detect and handle renames</li></ul>Git - the fast version control system<br />
  • 38. Resolving conflicts..<br />Suppose Jeff and Dan both made changes to the same line in file…<br />CONFLICT (content): Merge conflict in file<br />Automatic merge failed; fix conflicts and then commit the result.<br />Uh oh…. now what?<br />Git - the fast version control system<br />
  • 39. Resolving conflicts..<br />Well, just merge manually…<br /># run your favourite file merge application<br />$ git mergetool –t opendiff<br />Git - the fast version control system<br />
  • 40. Git - the fast version control system<br />source: http://gitguru.com<br />
  • 41. Resolving conflicts..<br />…and commit!<br /># commit to resolve the conflict<br />$ git commit<br />Git - the fast version control system<br />
  • 42. Branching<br />A core concept<br />Git - the fast version control system<br />
  • 43. Creating a branch..<br />Git - the fast version control system<br />
  • 44. Creating a branch..<br />Or create and switch to a branch based on another branch<br />$ git checkout –b new_branch other_branch<br />Git - the fast version control system<br />
  • 45. Some common scenarios…<br />Git - the fast version control system<br />Why would I require branching?<br />
  • 46. Scenario 1 – Interrupted workflow<br />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 <br />Git - the fast version control system<br />
  • 47. Scenario 1 – Interrupted workflow<br />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 <br />Git - the fast version control system<br />
  • 48. Scenario 2 – Quick fixes<br />While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug<br />Git - the fast version control system<br />
  • 49. Scenario 2 – Quick fixes<br />While you’re busy implementing some feature suddenly you’re being told to drop everything and fix a newly discovered bug<br />Git - the fast version control system<br />
  • 50. Git usage overview<br />Just to summarize…<br />Git - the fast version control system<br />
  • 51. Git command sequence<br />Source: http://git.or.cz<br />Git - the fast version control system<br />
  • 52. Tooling<br />Stuck at ‘Ye Olde Terminal’? Not necessarily…<br />Git - the fast version control system<br />
  • 53. Git UI front-ends<br />Git - the fast version control system<br />
  • 54. <ul><li> OpenInGitGui</li></ul>Git - the fast version control system<br />Finder extension<br />
  • 55. <ul><li> OpenInGitGui</li></ul>Git - the fast version control system<br />Finder extension<br /><ul><li> TortoiseGit
  • 56. Git Extensions</li></ul>Windows Explorer extensions<br />
  • 57. <ul><li> OpenInGitGui</li></ul>Git - the fast version control system<br />Finder extension<br /><ul><li> TortoiseGit
  • 58. Git Extensions</li></ul>Windows Explorer extensions<br /><ul><li> JGit / EGit</li></ul>Eclipse integration<br />
  • 59. Conclusion<br />Why switch to Git?<br />Git - the fast version control system<br />
  • 60. Reasons to switch to Git<br />Endless, easy, non-file-system-based, local branches<br />Enhanced merging strategy <br />Performance<br />Advanced features enable better workflow<br />Stashing temporary work<br />Collaboration before public commits<br />Git - the fast version control system<br />
  • 61. Closing and Q&A<br />References<br />Git: http://git-scm.com/download<br />Git Docs: http://git-scm.com/documentation<br />GitX: http://gitx.frim.nl/<br />TortoiseGit: http://code.google.com/p/tortoisegit/<br />Git Extensions: http://sourceforge.net/projects/gitextensions/<br />JGit / EGit: http://www.eclipse.org/egit/<br />Git - the fast version control system<br />

×