git - the stupid content tracker

1,711 views

Published on

Basic introduction to git, the object database and the most common commands.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,711
On SlideShare
0
From Embeds
0
Number of Embeds
9
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

git - the stupid content tracker

  1. 1. Introduction Basics Using git Other final Git - the stupid content tracker Henrik Austad UNINETT Sigma A/S 15. Oct 2009
  2. 2. Introduction Basics Using git Other final about:henrik Henrik Austad MSc Engineering Cybernetics UNINETT Sigma A/S & NDGF System Developer
  3. 3. Introduction Basics Using git Other final Background - In the beginning ... was patch • Initially written by Linus Torvalds to replace BitKeeper • First “working” version: April 18th 2005 • git v1.0 December 21th 2005 • Written for • Speed • Track changes • Large projects with active history
  4. 4. Introduction Basics Using git Other final Contenders • Bazaar (bzr) • Darcs • Mercurial (hg) • svk
  5. 5. Introduction Basics Using git Other final What does “distributed” mean? • Everything is local.
  6. 6. Introduction Basics Using git Other final What does “distributed” mean? • Everything is local. • No “need” for a centralized repository.
  7. 7. Introduction Basics Using git Other final What does “distributed” mean? • Everything is local. • No “need” for a centralized repository. • Disk is cheap - network is not.
  8. 8. Introduction Basics Using git Other final What does “distributed” mean? • Everything is local. • No “need” for a centralized repository. • Disk is cheap - network is not. • Lower threshold for new developers, you don’t need special access to the repository to get started.
  9. 9. Introduction Basics Using git Other final git objects • type • blob • tree • commit • tag • size • content
  10. 10. Introduction Basics Using git Other final git objects • type • blob • tree • commit • tag • size • content Figure: git example.credits: Scott Chacon
  11. 11. Introduction Basics Using git Other final Normal commands • git clone repo dest • git init
  12. 12. Introduction Basics Using git Other final Normal commands • git status • git log start..end • git branch name of new branch start commit • git checkout branchname
  13. 13. Introduction Basics Using git Other final Normal commands • git add path/to/file • git commit -s -m “short commit msg” • git rebase -i commit • git cherry-pick commit
  14. 14. Introduction Basics Using git Other final Normal commands • git remote • git push • git pull • git fetch
  15. 15. Introduction Basics Using git Other final Normal commands • git tag • git diff • git format-patch • git am
  16. 16. Introduction Basics Using git Other final Normal commands • git config –global user.name “Henrik Austad” • git config –global user.email “henrik@austad.us” • git config user.email “local@project.mail” • git config push.default current
  17. 17. Introduction Basics Using git Other final git merge vs. git rebase An example, 3 branches, commits done in alphabetical order
  18. 18. Introduction Basics Using git Other final git merge vs. git rebase Merge F and D giving H, then H and G giving I
  19. 19. Introduction Basics Using git Other final git merge vs. git rebase Rebase F onto D, rewriting F to F’, then C-F’ onto G
  20. 20. Introduction Basics Using git Other final Hooks - it’s a kind of magic See .git/hooks/ • pre-commit • post-update
  21. 21. Introduction Basics Using git Other final Visualization • git log –graph • git-gui • gitk • qgit
  22. 22. Introduction Basics Using git Other final Questions? http://git-scm.com/ mailto:git@vger.kernel.org http://www.kernel.org/pub/software/scm/git/docs/ everyday.html

×