Git Going With DVCS v1.5.1

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Git Going With DVCS v1.5.1 - Presentation Transcript

    1. Git going with DVCS mental spoo n bending 90 minutes of v ia source c ode control by Matthew McCullough of Ambient Ideas, LLC
    2. DVCS
    3. What? Why? Basic Use DVCS
    4. What? Why? Basic Use Who’s Theory DVCS Using Git? Deeper Use
    5. What? Why? Basic Use Who’s Theory DVCS Using Git? Deeper Use Usage Models GUIs High Points
    6. “ Git -noun sant or Slang. an unplea British cont emptible per son ” ionar y -Oxfo rd English Dict
    7. contrasts
    8. otistical bastard, and “ I'm an eg I name all my projects after myself. Fi rst Linux, now git. ” -Lin us Torvalds
    9. otistical bastard, and “ I'm an eg I name all my projects after myself. Fi rst Linux, now git. ” -Lin us Torvalds
    10. RCS Folders
    11. Clear Source Case Safe CVS PVCS RCS Folders
    12. Subversion BitKeeper Perforce Clear Source Case Safe CVS PVCS RCS Folders
    13. darcs Mercurial Bazaar Subversion BitKeeper Perforce Clear Source Case Safe CVS PVCS RCS Folders
    14. t Source Code Control Gi
    15. Gi Source Code Control t
    16. CultureChange
    17. Centralized VCS =Don’t
    18. Centralized VCS =Don’t
    19. Distributed VCS = Whatever! Do
    20. Innovate
    21. Experiment
    22. Safely Be Wrong
    23. Drive-by Assist
    24. Crowd Source
    25. Crowd Source
    26. Crowd Source
    27. Just show it to me!
    28. No, not on that!
    29. Download binaries
    30. Git Distro Sources Win Cygwin Win msysGit
    31. Git Distro Sources Win Cygwin Win msysGit Linux Source Linux Package manager
    32. Git Distro Sources Win Cygwin Win msysGit Linux Source Linux Package manager Mac MacPorts Mac git-osx-installer
    33. Git Distro Sources Win Cygwin Win msysGit Linux Source Linux Package manager Mac MacPorts Mac git-osx-installer Any JGit
    34. Put it in your path
    35. Identify yourself
    36. Global Git Settings git config --global user.name \"Hal Smith\" git config --global user.email \"hal@bnl.com\"
    37. Global Git Settings git config --list
    38. Global Git Settings git config --list t va lues t cu rren Outpu
    39. Use it!
    40. Creating a Repo mkdir myproj.git
    41. Creating a Repo mkdir myproj.git cd myproj.git
    42. Creating a Repo mkdir myproj.git cd myproj.git git init
    43. Creating a Repo ! mkdir myproj.git D O N E cd myproj.git git init
    44. Thanks for attending!
    45. Knobs and Dials
    46. 145+ Commands
    47. What? Why? Basic Use Who’s Theory DVCS Using Git? Deeper Use Usage Models GUIs High Points
    48. Who’s Got Git?
    49. Follow the DOTS
    50. Symmetric
    51. Symmetric
    52. Distributed
    53. pu sh
    54. pu sh
    55. push
    56. push
    57. pull
    58. pull
    59. Distributed
    60. Hashes and Integrity
    61. Index vs Hash ‣ Centralized VCS uses DB sequential index. ‣ Git uses SHA-1 hash.
    62. SHA-1 Hash ‣ Hash for the sake of integrity. ‣ Keep the source of the hash.
    63. SHA-1 Hash ‣ Hash for the sake of integrity. ‣ Keep the source of the hash. ught I tho ere es w hash r fo swo rds? pas
    64. Centralized VCS
    65. Alice Bob
    66. Alice Bob 1 = okay.htm
    67. Alice Bob 1 = okay.htm 2 = fine.htm
    68. Alice Bob 1 = okay.htm 2 = fine.htm svnsync
    69. Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm svnsync 2 = fine.htm
    70. Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm svnsync 2 = fine.htm 3 = good.htm
    71. Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm svnsync 2 = fine.htm 3 = good.htm 3 = great.htm
    72. Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm svnsync 2 = fine.htm 3 = good.htm 3 = great.htm svnsync
    73. Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm svnsync 2 = fine.htm 4 = good.htm 3 = good.htm 3 = great.htm svnsync 4 = great.htm
    74. Alice Bob 1 = okay.htm 1 = okay.htm 2 = fine.htm svnsync 2 = fine.htm ERROR 4 = good.htm 3 = good.htm 3 = great.htm ERROR svnsync 4 = great.htm
    75. Distributed VCS
    76. Alice Bob
    77. Alice Bob a233b76 = okay.htm
    78. Alice Bob a233b76 = okay.htm d234ab1 = fine.htm
    79. Alice Bob a233b76 = okay.htm d234ab1 = fine.htm Sync
    80. Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm Sync d234ab1 = fine.htm
    81. Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm Sync d234ab1 = fine.htm f90b12c = good.htm
    82. Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm Sync d234ab1 = fine.htm f90b12c = good.htm ae42ba0 = great.htm
    83. Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm Sync d234ab1 = fine.htm f90b12c = good.htm ae42ba0 = great.htm Sync
    84. Alice Bob a233b76 = okay.htm a233b76 = okay.htm d234ab1 = fine.htm Sync d234ab1 = fine.htm f90b12c = good.htm f90b12c = good.htm ae42ba0 = great.htm Sync ae42ba0 = great.htm
    85. Hashable Objects ‣ Blob ‣ Tree ‣ Commit ‣ Tag
    86. http://book.git-scm.com/1_the_git_object_model.html
    87. http://book.git-scm.com/1_the_git_object_model.html
    88. http://book.git-scm.com/1_the_git_object_model.html
    89. http://book.git-scm.com/1_the_git_object_model.html
    90. Hash Benefits Independence ‣ Time & location separation from sequence # of checkin. ‣ Easy merging of repositories ‣ Easy identification of what needs to be synced
    91. Hash Benefits Integrity ‣ Identifies damaged repos. ‣ Prevents modification of published history. ‣ Unique to file size and contents.
    92. Hash Benefits Tags ‣ Cryptographically sign tags by GPG. ‣ Guaranteeing the repo’s state at a point in time.
    93. Location,Location,Location
    94. Single Stage Thinking of Subversion
    95. Subversion ‣ svn commit ‣ Adds everything modified. ‣ “committed” locally and on the server. ‣ Must list if you want specific files. ‣ What if you check in your password?
    96. $ echo //COMMENTS >> Matt1.java $ echo //THOUGHTS >> Matt2.java
    97. $ echo //COMMENTS >> Matt1.java $ echo //THOUGHTS >> Matt2.java $ svn status M Matt1.java M Matt2.java
    98. $ echo //COMMENTS >> Matt1.java $ echo //THOUGHTS >> Matt2.java $ svn status M Matt1.java M Matt2.java $ svn commit -m'Matts checkin' Adding Matt1.java Adding Matt2.java Transmitting file data . Committed revision 2.
    99. Three Stage Thinking of Git
    100. Git ‣ git add ‣ git commit ‣ git push ‣ Commits only what is added to the index. ‣ Opportunity to change history locally. ‣ Selectively share with other repos.
    101. repo git clone git://somedomain/myproj.git B uild cd myproj.git
    102. repo git clone git://somedomain/myproj.git B uild cd myproj.git dex pda te in git checkout master U
    103. repo git clone git://somedomain/myproj.git B uild cd myproj.git dex pda te in git checkout master U echo ‘//Comments’ >> ClassOne.java or king echo ‘//Thoughts’ >> ClassTwo.java E dit w
    104. repo git clone git://somedomain/myproj.git B uild cd myproj.git dex pda te in git checkout master U echo ‘//Comments’ >> ClassOne.java or king echo ‘//Thoughts’ >> ClassTwo.java E dit w to i ndex git add ClassOne.java Add epo ave to r git commit -m’Added comments’ S
    105. repo git clone git://somedomain/myproj.git B uild cd myproj.git dex pda te in git checkout master U echo ‘//Comments’ >> ClassOne.java or king echo ‘//Thoughts’ >> ClassTwo.java E dit w to i ndex git add ClassOne.java Add epo ave to r git commit -m’Added comments’ S st ash git stash Pus h to
    106. Remote is like a special Stash Repo Index Working
    107. Remote is like a special Stash Repo Index Working
    108. Remote is like a special Stash Repo git clone Index Working
    109. Remote is like a special Stash Repo git clone git checkout Index Working
    110. Remote is like a special Stash Repo git clone git checkout edit experiment files Index Working
    111. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash Index Working
    112. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash test buggy files Index Working
    113. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash test buggy files Index git stash apply Working
    114. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash test buggy files Index git stash apply Working git add
    115. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash test buggy files Index git stash apply Working git add git commit
    116. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash test buggy files Index git stash apply Working git add git commit git push
    117. Remote is like a special Stash Repo git clone git checkout edit experiment files git stash test buggy files Index git stash apply Working git add git commit git push
    118. What does this buy me?
    119. $ echo //MYD0GSNAM3 >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt
    120. $ echo //MYD0GSNAM3 >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt
    121. $ echo //MYD0GSNAM3 >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt o in dex int $ git add mattfile1.txt Put
    122. $ echo //MYD0GSNAM3 >> mattfile1.txt $ echo //NewText2 >> mattfile2.txt $ git status # On branch master # Changed but not updated: # modified: mattfile1.txt # modified: mattfile2.txt o in dex int $ git add mattfile1.txt Put to r epo S ave $ git commit -m'Matts pw checkin' [master]: created ddcdf18: \"Matts pw checkin\" 1 files changed, 1 insertions(+), 0 deletions(-)
    123. #$%^&! I just committed my password!
    124. Change History $ git reset --hard HEAD^ HEAD is now at 9de4cd3 First checkin $ git log commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993 Author: Matthew McCullough <matthewm@ambientideas.com> Date: Wed Mar 4 23:09:17 2009 -0700 First checkin
    125. Change History com mit the w a way $ git reset --hard HEAD^ T hro HEAD is now at 9de4cd3 First checkin $ git log commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993 Author: Matthew McCullough <matthewm@ambientideas.com> Date: Wed Mar 4 23:09:17 2009 -0700 First checkin
    126. Change History com mit the w a way $ git reset --hard HEAD^ T hro HEAD is now at 9de4cd3 First checkin $ git log commit 9de4cd3a3f24a3de3e804df84cc3321c7d0c9993 Author: Matthew McCullough <matthewm@ambientideas.com> Date: Wed Mar 4 23:09:17 2009 -0700 First checkin
    127. Sharing
    128. Serving It Up Protocols ‣ GIT ‣ SSH ‣ SCP ‣ Local file system ‣ SAMBA ‣ HTTP ‣ WebDAV ‣ rsync
    129. Serving It Up Network ‣ git instaweb. Built in, read-only, HTTP. ‣ git daemon. Custom socket language. ‣ gitosis. Easy permissions control. ‣ github. Open source & private repos. ‣ ssh. OS controlled permissions.
    130. Serving It Up Filesystem ‣ Local folders. Yes, they can be “remotes.” ‣ Mapped network drives. Just like folders.
    131. aem on git clone git://somehost.org/myproj.git g it d
    132. aem on git clone git://somehost.org/myproj.git g it d git clone mccm06@somehost.org:myproj.git SSH
    133. aem on git clone git://somehost.org/myproj.git g it d git clone mccm06@somehost.org:myproj.git SSH git clone http://somehost.org/myproj.git H TTP
    134. aem on git clone git://somehost.org/myproj.git g it d git clone mccm06@somehost.org:myproj.git SSH git clone http://somehost.org/myproj.git H TTP sys tem git clone ~/work/myproj.git File
    135. aem on git clone git://somehost.org/myproj.git g it d git clone mccm06@somehost.org:myproj.git SSH git clone http://somehost.org/myproj.git H TTP sys tem git clone ~/work/myproj.git File rk d rive Ne two git clone z:\\someserver\\myproj.git
    136. Merge & Rebase
    137. Cheap Branches
    138. Cheap Branches git show-branch --all git branch -a ‣Local branch ‣localbranchname ‣Remote ‣remote/branchname
    139. Merge Anything
    140. Merge Anything git merge --no-commit <sourcebranch> git merge --squash <sourcebranch> git merge <sourcebranch1> <sourcebranch2> ‣Selectable merge strategy ‣Octopus: More than one ‣Review before committing ‣Flatten micro-checkins
    141. Rebase for Clarity
    142. Rebase for Clarity git checkout myfeaturebranch git rebase master ‣Cleaner history than a merge. ‣Fast forwards original branch. ‣Lets you see “how trunk will act” before you merge. ‣Reposition your feature branch’s start point. ‣Makes for simpler merge graphs.
    143. M da S er r ta g d n e Master/Trunk/MainLatest
    144. M da S er r ta g d n e Master/Trunk/MainLatest a32
    145. ard Bra d n e ta g a32 n ch S er Master/Trunk/MainLatest M 2e2
    146. ard Bra d n e ta g a32 n ch S er Master/Trunk/MainLatest d19 M 2e2
    147. ard Bra d n e ta g a32 n ch S er Master/Trunk/MainLatest d19 M 2e2 8b3
    148. ard Bra d n e ta g a32 n ch S er Master/Trunk/MainLatest d19 M 2e2 e69 8b3
    149. ard Bra d n e ta g a32 n ch S er Master/Trunk/MainLatest d19 M 2e2 e69 8b3 erge M 9f1
    150. Rebasing Master/Trunk/MainLatest
    151. Rebasing Master/Trunk/MainLatest a32
    152. Rebasing Master/Trunk/MainLatest a32 2e2 Bra ch n
    153. Bra sing a32 n ch ba Master/Trunk/MainLatest Re 2e2 d19
    154. Bra sing a32 n ch ba Master/Trunk/MainLatest Re 2e2 d19 8b3
    155. Bra sing a32 n ch ba Master/Trunk/MainLatest Re 2e2 d19 8b3 e69
    156. Master/Trunk/MainLatest a32 2e2 8b3 Bra ch n d19 e69 Rebase
    157. a32 Master/Trunk/MainLatest 2e2 8b3 Bra n ch d19 d19 Me rg e e69 e69
    158. WorkingOffline
    159. Offline Anything Checkin
    160. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove
    161. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove practically everything but push
    162. Offline Anything Checkin Add Branch List change log Grep history Rewrite history Stash Merge Label Remove practically everything but push
    163. Hooray! Another checkin to my latest OSS project!
    164. Hooray! Another checkin to my latest OSS project! I think I liked subversion better...
    165. Speed
    166. git: git hg: mercurial bzr: bazaar
    167. Init Add Status Diff Branch (Cold/Hot) git hg bzr git hg bzr git hg bzr git hg bzr Tag Log Commit (Lg) Commit (Sm) git c git h hg c hg h bzr c bzr h git hg bzr git hg bzr git hg bzr git hg bzr data from http://whygitisbetterthanx.com/#git-is-fast
    168. 10 to 100 times Faster
    169. VCS Interop
    170. Subversion git svn clone http://unfurl.com/trunk git svn dcommit
    171. Subversion git svn clone http://unfurl.com/trunk git svn dcommit ‣ First class compatibility.
    172. Subversion git svn clone http://unfurl.com/trunk git svn dcommit ‣ First class compatibility. ‣ Round trip support.
    173. Subversion git svn clone http://unfurl.com/trunk git svn dcommit ‣ First class compatibility. ‣ Round trip support. ‣ Git commits = svn commits.
    174. Migration ‣ git svn clone
    175. Migration ‣ git svn clone ‣ Power off your Subversion server.
    176. What? Why? Basic Use Who’s Theory DVCS Using Git? Deeper Use Usage Models GUIs High Points
    177. UsageModels
    178. Centralized Central Repo
    179. Centralized Central Repo
    180. Repo Blessed Dictatorship
    181. Repo Blessed Dictatorship
    182. Repo Blessed Dictatorship
    183. Repo Blessed Dictatorship
    184. Repo Blessed Dictatorship
    185. Certified Integration Managed Development Repo Repo
    186. Certified Integration Managed Development Repo Repo
    187. Certified Integration Managed Development Repo Repo
    188. Certified Integration Managed Development Repo Repo
    189. Mirror Mirror Certified Development Repo Repo Mirrored
    190. Mirror Mirror Certified Development Repo Repo Mirrored
    191. Mirror Mirror Certified Development Repo Repo Mirrored
    192. Mirror Mirror Certified Development Repo Repo Mirrored
    193. Mirror Mirror Certified Development Repo Repo Mirrored
    194. ☚ Private Public ☛ GitHub Custom + Public Contrib
    195. ☚ Private Public ☛ GitHub Custom + Public Contrib
    196. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
    197. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
    198. ☚ Private Public ☛ Customized GitHub Custom + Public Contrib
    199. GUIs
    200. GitX
    201. GitSafe
    202. GitK
    203. GitGUI
    204. EGit
    205. ci a l ! O f fi It ’s
    206. 4 reasons
    207. Cherry Pick ❹
    208. Cherry Pick ❹
    209. Cherry Pick ‣git ❹ cherry-pick a5b2ee
    210. Cherry Pick ‣git ❹ cherry-pick a5b2ee ‣Merge in just one commit.
    211. Cherry Pick ‣git ❹ cherry-pick a5b2ee ‣Merge in just one commit. ‣When you want a nugget, not a branchload.
    212. Bisect Bugs ❸
    213. Bisect Bugs ❸
    214. Bisect Bugs ‣git ❸ bisect run mvn test
    215. Bisect Bugs ‣git ❸ bisect run mvn test ‣Binary-search for bug.
    216. Bisect Bugs ‣git ❸ bisect run mvn test ‣Binary-search for bug. ‣Manual or automated modes.
    217. Squash Verbosity ❷
    218. Squash Verbosity ❷
    219. Squash Verbosity ❷ ‣git merge --squash mybranch
    220. Squash Verbosity ❷ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits.
    221. Squash Verbosity ❷ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. ‣Make mistakes, revise, checkin without hesitation.
    222. Squash Verbosity ❷ ‣git merge --squash mybranch ‣Reduce all your micro-checkins to block commits. ‣Make mistakes, revise, checkin without hesitation. ‣Great for SVN compatibility.
    223. Search History ❶
    224. Search History ❶
    225. Search History ‣git ❶ grep SomeText HEAD^^^
    226. Search History ‣git ❶ grep SomeText HEAD^^^ ‣Search in file history without checkout.
    227. Search History ‣git ❶ grep SomeText HEAD^^^ ‣Search in file history without checkout. ‣Greps contents.
    228. emerging Control Version
    229. Twitter @matthewmccull Matthew Blog http://www.ambientideas.com/blog sidebar has all my social media links Email matthewm@ambientideas.com GitHub http://github.com/matthewmccullough
    230. Resources Git Homepage http://git-scm.com Directed Acrylic Graph http://en.wikipedia.org/wiki/Directed_acyclic_graph Git for Computer Scientists http://eagain.net/articles/git-for-computer-scientists/ Git Treeish http://book.git-scm.com/4_git_treeishes.html
    231. Resources Git Docs http://www.kernel.org/pub/software/scm/git/docs/ Git Magic eBook http://www-cs-students.stanford.edu/~blynn/gitmagic/book.pdf Linus Torvald’s Git talk at Google http://www.youtube.com/watch?v=4XpnKHJAok8 CygWin http://www.cygwin.com
    232. Resources MSysGit http://code.google.com/p/msysgit Git Cheetah http://code.google.com/p/msysgit/wiki/GitCheetah Matthew’s Git Bookmarks http://delicious.com/matthew.mccullough/git Matthew’s Bash Prompt http://gist.github.com/47267
    233. Image Credits ‣ http://www.ambientideasphotography.com ‣ http://flickr.com/photos/lenore-m/2903856664/ ‣ http://en.wikipedia.org/wiki/Git_(software) ‣ http://flickr.com/photos/karenhorton/1583513014/ ‣ http://flickr.com/photos/mashdnart/2545782407/ ‣ http://commons.wikimedia.org/wiki/ File:Small_Boy_nuclear_test_1962.jpg ‣ http://www.flickr.com/photos/knmurphy/2506896257/ ‣ http://www.flickr.com/photos/albyspace/1022035568/ ‣ http://flickr.com/photos/michaelhays/3070238360/ ‣ http://flickr.com/photos/d_vdm/509996632/

    + Matthew McCulloughMatthew McCullough, 6 months ago

    custom

    519 views, 0 favs, 1 embeds more stats

    IASA presentation of Git talk

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 519
      • 513 on SlideShare
      • 6 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 14
    Most viewed embeds
    • 6 views on http://www.mr-san.com

    more

    All embeds
    • 6 views on http://www.mr-san.com

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories