M.Mozūras - git

898 views
866 views

Published on

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

  • Be the first to like this

No Downloads
Views
Total views
898
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

M.Mozūras - git

  1. 1. git or: how I learned to stopworrying and love source control
  2. 2. why you should care
  3. 3. Traditional version controlsystems have deficiencies
  4. 4. Subversion, Perforce, CVS, TFS...
  5. 5. OH, TSLOW HE PATREE CONFLICTS IN!MERGING IS CHALLENGINGBRANCHES ARE JUST COPIES
  6. 6. using svn
  7. 7. using git
  8. 8. git is awesome
  9. 9. It’s distributed!Distributed Version Control System
  10. 10. Every repository is equal.
  11. 11. You can work offline.
  12. 12. Fast as lightning.
  13. 13. add status diff log commit branch git mercurial bazaar
  14. 14. Very efficient.git clone rails - 53 seconds40mb, 2356 files, 29045 commits
  15. 15. Great branching and merging.
  16. 16. Any workflow you want,you got it...
  17. 17. Shared repository
  18. 18. Linus Torvalds Blessed repositoryLieutenantsDevelopers
  19. 19. how to install
  20. 20. Linux: apt-get install git-coreMac OS X: brew install gitWindows: chocolatey install msysgit
  21. 21. Download from git-scm.com
  22. 22. gettingstarted
  23. 23. git config --global user.name ...git config --global user.email ...
  24. 24. git init
  25. 25. master has no special meaning.It’s just a default branch.
  26. 26. git add
  27. 27. Staging area stores info aboutwhat will go into next commit.
  28. 28. working staging area repositorydirectory checkout the project stage files commit
  29. 29. git commit
  30. 30. Commit “name” is a 40-digit SHA189f30b664981e4397625791c8ea3bbb5f2279a3
  31. 31. commit 189f30b... tree e8455...parent(s) nil author Mindaugas...committer Mindaugas... Initial commit
  32. 32. tree e8455...blob bc52a... README.md
  33. 33. blob bc52a...
  34. 34. SVN, CVS, Perforce storedifferences between commits.
  35. 35. Git stores snapshots.
  36. 36. commit0 commit1 commit2 tree0 tree1 tree2blob A blob A blob A2 blob B blob B2 blob B2
  37. 37. Basictrainingcomplete.
  38. 38. pushing and pulling
  39. 39. git remote add origin git@git...
  40. 40. git push origin master
  41. 41. git pull origin master
  42. 42. branching and merging
  43. 43. git branch name
  44. 44. Branch is a reference to thehead of a line of work.
  45. 45. masterC0 C1 feature
  46. 46. git checkout name
  47. 47. git merge name
  48. 48. masterC0 C1 C2 F1 F2 feature
  49. 49. masterC0 C1 C2 C3 F1 F2 feature
  50. 50. git rebase name
  51. 51. masterC0 C1 C2 F1 F2 feature
  52. 52. masterC0 C1 F1 F2 C2 feature
  53. 53. merge is fine, but in a lot ofcases, rebase is better.
  54. 54. Branching - too easy not to do
  55. 55. manipulatinghistory
  56. 56. git commit --amend
  57. 57. git rebase --interactive
  58. 58. Interactive rebase lets you:reword, edit, squash, fixup,exec, remove and reorder.
  59. 59. Be carefu l!You can change history of remoterepository with git push --force.
  60. 60. Rewritinghistory is funand useful!
  61. 61. git- svn
  62. 62. git svn clone http://...
  63. 63. git svn rebase ~ svn update
  64. 64. git svn dcommit ~ svn commit
  65. 65. GitHub
  66. 66. The best way to collaborate.
  67. 67. More than 1.6 million people, 2.8 million repositories.
  68. 68. Used by individuals.
  69. 69. And organizations.
  70. 70. closing thoughts
  71. 71. blame bisect cherry-pick cleancvsimport describe diff fetchfilter-branch grep request-pullrevert svnimport stashsubmodule tag and more...
  72. 72. RESgit-scm.com OURgitready.com CESgitimmersion.comontwik.com/category/git-github
  73. 73. Git != Subversion + Magic
  74. 74. The slogan of Subversion for awhile was "CVS done right". If youstart with that kind of slogan,theres nowhere you can go. Thereis no way to do CVS right. Linus Torvalds
  75. 75. thanks to:Zach Holman @holmanthenounproject.com
  76. 76. thanks!codingfearlessly.comtwitter.com/mmozurasgithub.com/mmozuras

×