Your SlideShare is downloading. ×

Git, an Illustrated Primer

456

Published on

Given at the July BCSPHP Meeting …

Given at the July BCSPHP Meeting

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

No Downloads
Views
Total Views
456
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
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. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comGIT: An Illustrated Primer
  • 2. http://mojolive.com/profile/dcousineauDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 3. HistoryDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 4. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comBitKeeper No Longer Free To UseLinux Kernel RequiresDistributedPerformantSVN and CVS... Not So Much“CVS is what we should NOT do...”
  • 5. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comGITthus,
  • 6. gIttingstartedDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 7. +LinuxDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> sudo apt-get install git$> sudo yum install git$> echo "Seriously?"
  • 8. +OSXDaniel Cousineau // follow me : @dcousineau or http://dcousineau.comhttp://git-scm.com
  • 9. +OSXDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)$> brew install git$> say "Win!"
  • 10. +WindowsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.comhttp://windows.github.com
  • 11. +Gitting STartedDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 12. +My First RepoDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 13. +Stage New FilesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 14. +Commit StagingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 15. +staging?Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comworking directoryindexrepository
  • 16. +staging?Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comworking directoryindexrepository“staging”
  • 17. +staging?Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comworking directoryindexrepositorymodify
  • 18. +staging?Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comworking directoryindexrepositorygit add
  • 19. +staging?Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comworking directoryindexrepository git commit
  • 20. +DirectoriesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 21. +ModifyDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 22. +Branch!Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 23. +Back to MasterDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 24. +Merge!Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 25. +stashingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 26. +PoppingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 27. branchingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 28. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.coma b cMASTERHEAD
  • 29. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.coma b cMASTERDEVELOPcreate new branchHEAD
  • 30. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.coma b cMASTERDEVELOPCheckout new branchHEAD
  • 31. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.coma b cMASTERDEVELOPcommit to developdHEAD
  • 32. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comcommit to master HEADa b cMASTERDEVELOPde
  • 33. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.coma b cMASTERDEVELOPmerge Developdef
  • 34. RemoteDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 35. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comSVN GITdebacdebacd debac
  • 36. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 37. +Create a ProjectDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 38. +Create a ProjectDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 39. +Doing as I am toldDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 40. +did as I was toldDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 41. +Push Again!Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 42. +Fetching & MergingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 43. +PullingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 44. +Two Authors Two PushesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 45. +Two Authors Two PushesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 46. +AFtermathDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 47. +AftermathDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 48. +AftermathDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 49. +AFtermathDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 50. +forkingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 51. +pull requestsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 52. +MAke Changes IN A NEW BRANCHDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 53. +Push ChangesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 54. +See Our New BranchDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 55. +Create Pull RequestDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 56. +Oh Look, Our Pull RequestDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 57. +Oh Look Our Pull RequestDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 58. +Oh Look, It’s Merged In!Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 59. +RemotesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 60. +Adding Another RemoteDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 61. +create and sync new branchesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 62. +Delete local and remote branchesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 63. +Pull From One, Push To AnotherDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 64. GIT FLowDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 65. http://nvie.com/posts/a-successful-git-branching-model/
  • 66. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 67. Subversionand GITDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 68. +et voilàDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git svn clone -s -r 1000:HEAD https://url/to/repo ./wkngcpy$> git svn show-ignore > .gitignore
  • 69. +WorkflowDaniel Cousineau // follow me : @dcousineau or http://dcousineau.comNormal GIT Workflow
  • 70. +SyncDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git svn dcommit --dry-run$> git svn dcommit$> git svn rebase
  • 71. +With some caveatsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.comanything that has been dcommit’dis set in stone! do. not. touch.git branches wellsvn... not so much
  • 72. +Local BranchingDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git merge --squash branch
  • 73. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comgit merge --squash localbrnHEADa bcMASTERlocalbrnd e
  • 74. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comgit merge --squash localbrnHEADa bMASTERDEC
  • 75. +Why?Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comSVN is TERRIBLE at mergesgit-svn will do it if you don’tand when it fails, it does so spectacularlyyou’ll just litter your commit history
  • 76. +tracking svn branchesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git checkout -t remotes/branchname
  • 77. +creating remote branchesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git svn branch -m “Creating new branch” branchname$> git checkout -t remotes/branchname
  • 78. +personal opinionDaniel Cousineau // follow me : @dcousineau or http://dcousineau.comexcept for release taggingand a develop branchdon’t bother with remote branchingjust stick to local and squashes
  • 79. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comuse git svnlocallypush forteamadoptionprocure gitserverfull clonepush to newgit server
  • 80. Daniel Cousineau // follow me : @dcousineau or http://dcousineau.comuse git svnlocallypush forteamadoptionprocure gitserverfull clonepush to newgit server
  • 81. AdvancedUsageDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 82. +reset my local changesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git checkout -- .tell git “no more options!”
  • 83. +Replay Last commitDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git reset --mixed REF
  • 84. +Gitting ReadyDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 85. +ResultsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 86. +Undo Last commitDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git reset --hard HEAD^HEAD^ means commit priorto HEAD. HEAD^2 is 2commits prior, etc etc.
  • 87. +“Oops i forgot to branch”Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git branch newbranchname$> git reset --hard SHAcommit immediately beforethe intended first commitof our new branch
  • 88. +“Oops i forgot to branch”Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 89. +“Oops i forgot to branch”Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 90. +“Oops I accidentally the commit message”Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git rebase --interactive SHAcommit immediatelypreceding the commit inquestion
  • 91. +OopsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 92. +Lay of the landDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 93. +Making decisionsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 94. +Reach 88MPHDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 95. +Fun with ParadoxesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 96. +Fruits of our laborDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 97. +“Oops I committed the private key”Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com$> git filter-branch --index-filter git rm --cached --ignore-unmatch secret.key --prune-empty --tag-name-filter cat -- --allಠ_ಠ
  • 98. +Terrible MistakeDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 99. +gone now, here yesterdayDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 100. +VooDoo MagicDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 101. +ResultsDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 102. +Cleanup The MessDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 103. +Look Ma, No secret.key!Daniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 104. THANKS.FOR YOUR ATTENTIONDaniel Cousineau // follow me : @dcousineau or http://dcousineau.com
  • 105. +further resourcesDaniel Cousineau // follow me : @dcousineau or http://dcousineau.comhttp://git-scm.com/bookFREE!Attribution-NonCommercial-ShareAlike 3.0 Unportedhttps://help.github.com

×