Github - Git Training Slides: Foundations
Upcoming SlideShare
Loading in...5
×

Like this? Share it with your network

Share

Github - Git Training Slides: Foundations

  • 1,117 views
Uploaded on

Slide deck with detailed step breakdown that explains how git works, together with simple examples that you can try out yourself. Slides originated from......

Slide deck with detailed step breakdown that explains how git works, together with simple examples that you can try out yourself. Slides originated from http://teach.github.com/articles/course-slides/

Author: https://twitter.com/matthewmccull

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
1,117
On Slideshare
1,117
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
48
Comments
0
Likes
5

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 FoundationsAn exploration of the Git toolbox Officialtrainingcurriculumv3.1.0©2012,GitHub,Inc.
  • 2. Hello!
  • 3. Matthew McCullough @matthewmccull
  • 4. Ma hew who? ‣Open source contributor ‣Build tool book co-author ‣Continuous integration book co-author ‣5 year Git evangelist ‣VP of Training at GitHub
  • 5. Welcome ‣Questions, Pacing ‣Ask questions at any time. Don't wait! ‣Suggest course pacing slowing/speeding up
  • 6. Git Where’s this coming from?
  • 7. Git
  • 8. Git? Open Source
  • 9. Git? bash scripts C code
  • 10. Git? ≉
  • 11. Git -noun British Slang. an unpleasant or contemptible person -Oxford English Dictionary “ ”
  • 12. I'm an egotistical bastard, and I name all my projects after myself. First Linux, now git. -Linus Torvalds “ ”
  • 13. Git What is this thing?
  • 14. GIT - the stupid content tracker "git" can mean anything, depending on your mood. * random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant. * stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang. * "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room. * "goddamn idiotic truckload of sh*t": when it breaks Git is a fast, scalable, distributed revision control system with an unusually rich command set that provides both high-level operations and full access to internals. Git is an Open Source project covered by the GNU General Public License. It was originally written by Linus Torvalds with help of a group of hackers around the net. It is currently maintained by Junio C Hamano. “ ”
  • 15. file trackercontent
  • 16. Git? centralized version control systems have matured
  • 17. CVS Subversion PVCS Perforce Clear CaseSource Safe RCS Folders Git?
  • 18. small improvements, but no radical innovation Git?
  • 19. Linus? Git?
  • 20. I did end up using CVS for 7 years at a commercial company and I hate it with a passion... The slogan of Subversion for a while was "CVS done right"... and if you start with that kind of slogan, there's nowhere you can go. There is no way to do CVS right. -Linus Torvalds “ ”
  • 21. VCS reboot Git?
  • 22. 50% Distributed Version Control Git? 50% Git Concepts with
  • 23. 1997 code co-op
  • 24. 2001 arch
  • 25. 2003 monotone
  • 26. 2003 SVK
  • 27. 2003 darcs
  • 28. 2005 bazaar
  • 29. 2005 mercurial
  • 30. 2005 git
  • 31. time to mature
  • 32. most unique improvements
  • 33. largest DVCS user base
  • 34. Setup Testing Git
  • 35. Setting up Git Check your Git version... git --version
  • 36. Setup What is a Git install?
  • 37. Setting up Git binaries on your $PATH
  • 38. Using Creating a repository
  • 39. Creating A Repository # Green field project $ git init newproject $ cd newproject # ...start coding
  • 40. Creating A Repository ‣Create our first repository
  • 41. Creating A Repository or if you already have source code
  • 42. Creating A Repository # Legacy project tree $ cd existingproject $ git init # Add all the code $ git add . $ git commit -m”Initial import”
  • 43. Using What’s in .git?
  • 44. Contents of .git .git !"" COMMIT_EDITMSG !"" HEAD !"" MERGE_RR !"" config !"" description !"" hooks #   !"" pre-commit.sample #   $"" update.sample !"" index !"" info #   $"" exclude !"" logs #   !"" HEAD #   $"" refs #   $"" heads #   $"" master !"" objects #   !"" 54 #   #   $"" 3b9bebdc6bd5c4b22136034a95dd097a57d3dd #   !"" info #   $"" pack !"" refs    !"" heads    #   $"" master    $"" tags
  • 45. Three stage thinking ‣Explore the .git folder
  • 46. Configuration Display
  • 47. Configuring Git Query existing configuration
  • 48. Configuring Git All entries
  • 49. Configuring Git #List all config values git config --list
  • 50. Configuring Git Single entry
  • 51. Configuring Git #Query effective value of a single key git config section.key git config section.subsection.key
  • 52. Configuring Git #Show a specific config value git config user.name git config user.email
  • 53. Configuration Layers
  • 54. Config Targets git config --system #Saves to /etc/gitconfig
  • 55. Config Targets git config --global #Saves to ~/.gitconfig
  • 56. Config Targets git config --local #Saves to .git/config
  • 57. Configuring Git #Configure a setting in a .git repository git config __________ git config --local __________ #Configure a setting in the user's home dir git config --global __________ #Configure a setting in the Git install dir # e.g. /usr/local/Cellar/git/1.7.x/etc/gitconfig git config --system __________
  • 58. Config Targets Git configuration reading & writing targets local by default
  • 59. Configuration Inheritance
  • 60. Config Inheritance Query existing configuration by layer
  • 61. Config Inheritance #Query a single key in a single layer git config --<WHERE> section.key git config --<WHERE> section.subsection.key
  • 62. Config Inheritance #List all system config values git config --system --list
  • 63. Config Inheritance #List all global config values git config --global --list
  • 64. Config Inheritance #List all local config values git config --local --list
  • 65. Config Inheritance #List effective config values git config --list
  • 66. Configuration Set user identity
  • 67. Set User Identity any config at any layer
  • 68. Set User Identity #List the current config git config --global user.name "Fird Birfle" git config --global user.email "fird@birfle.com"
  • 69. Set User Identity just a string
  • 70. Set User Identity user identity
  • 71. Set User Identity user identityauthenticationnot
  • 72. Set User Identity user identityauthenticationauthorizationnot
  • 73. Configuration Display color
  • 74. Set Console Color console color
  • 75. Set Console Color git config --global color.ui always
  • 76. Set Console Color git log --graph --decorate --simplify-by-decoration --abbrev-commit --date=relative --pretty=oneline --all
  • 77. Configuring Git git log --graph --decorate --simplify-by-decoration --abbrev-commit --date=relative --pretty=oneline --all | more
  • 78. Set Console Color Bleh!
  • 79. Set Console Color output destination detection
  • 80. Set Console Color git config --global color.ui auto # or the identical effect with... git config --global color.ui true
  • 81. Set Console Color git log --graph --decorate --simplify-by-decoration --abbrev-commit --date=relative --pretty=oneline --all | more
  • 82. Set Console Color when you need itColor
  • 83. Set Console Color only when you need itColor
  • 84. Configuration Line endings
  • 85. Line Endings line endings
  • 86. Line Endings VS
  • 87. Line Endings VS LF CRLF
  • 88. Line Endings default is to do nothing
  • 89. Line Endings http://help.github.com/dealing-with-lineendings/
  • 90. Line Endings #Force files to be LF in the repo, # even on Mac/Linux git config --global core.autocrlf input #Force Windows to convert to platform # on checkout and to LF on commit git config --global core.autocrlf true
  • 91. Line Endings #Force files to be LF during `add` git config --global core.autocrlf input #Force Windows to convert to CRLF # on checkout and to LF on `add` git config --global core.autocrlf true
  • 92. warn about conversion
  • 93. Line Endings #Never complain about line ending conversion git config --global core.safecrlf false #Warn, but allow line ending conversion to proceed #(the default) git config --global core.safecrlf warn #Do not allow line ending conversion to proceed git config --global core.safecrlf true
  • 94. Configuration Secure Sockets Host (SSH)
  • 95. Configuring SSH ‣Generate an ssh key pair
  • 96. Configuring SSH ssh key pair
  • 97. Configuring SSH $ ssh-keygen -t rsa -C”For GitHub”
  • 98. Configuring SSH $ ssh-keygen -t rsa -C”For GitHub”
  • 99. Configuring SSH
  • 100. Configuring SSH # Verify the files were created $ cd ~/.ssh $ ls
  • 101. Configuring SSH
  • 102. Configuring SSH ‣id_rsa is the private half of the key ‣Keep this uncompromisingly secret ‣id_rsa.pub is the public half of the key ‣Give this away freely
  • 103. Configuring SSH #GitHub sanity test ssh -T git@github.com > Hi matthewmccullough! You've successfully authenticated, but GitHub does not provide shell access.
  • 104. Configuring SSH #GitHub sanity test with verbose SSH ssh -v git@github.com >OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009 debug1: Reading configuration data /Users/mccm06/.ssh/config debug1: Reading configuration data /etc/ssh_config debug1: Connecting to github.com [207.97.227.239] port 22. debug1: Connection established. debug1: identity file /Users/mccm06/.ssh/identity type -1 debug1: identity file /Users/mccm06/.ssh/id_rsa type 1 debug1: identity file /Users/mccm06/.ssh/id_dsa type 2 ... debug1: Host 'github.com' is known and matches the RSA host key. debug1: Found key in /Users/mccm06/.ssh/known_hosts:3 debug1: ssh_rsa_verify: signature correct ... debug1: Trying private key: /Users/mccm06/.ssh/identity debug1: Offering public key: /Users/mccm06/.ssh/id_rsa debug1: Remote: Forced command: gerve matthewmccullough
  • 105. Using Git Three Stage Thinking
  • 106. Three stage thinking ‣Edit ‣Add ‣Commit
  • 107. Three stage thinking Working Staging Repo add commit edit
  • 108. Three stage thinking
  • 109. ‣shopping cart ‣put things in ‣take things out ‣purchase at register
  • 110. Three stage thinking
  • 111. Three stage thinking ‣database transaction ‣update values ‣insert rows ‣delete rows ‣commit transaction
  • 112. Three stage thinking only onestaging area
  • 113. Three stage thinking Working Staging Repo add commit edit
  • 114. Setup Commit Message Editor
  • 115. Commit Message Editor
  • 116. ✓? Used the VI editor?
  • 117. Commit Message Editor I y ;WQ
  • 118. Commit Message Editor an alternate editor?
  • 119. Commit Message Editor $EDITOR environment variable O ption 1
  • 120. Commit Message Editor $ export EDITOR=<AnEditorOnYourPath> O ption 1
  • 121. Commit Message Editor GitPad wraps Notepad (or $EDITOR) O ption 2
  • 122. Commit Message Editor http://github.com/github/GitPad O ption 2
  • 123. Commit Message Editor Run GitPad ...registers & wraps Notepad as the editor O ption 2
  • 124. Commit Message Editor Git-specific configuration option O ption 3
  • 125. Commit Message Editor #for TextMate on Mac git config --global core.editor "mate -w" #for Notepad2 on Windows git config --global core.editor "notepad2.exe" #for emacs on Linux git config --global core.editor "emacs" O ption 3
  • 126. Commit Message Editor O ption 3
  • 127. Commit Message Editor ‣Toggle to alternate editor ‣Make a commit ‣Test that the new editor pops up
  • 128. Usage Basics Adding & committing code
  • 129. Three stage thinking $ vi first.html $ git status $ git add first.html $ git commit -m”First commit”
  • 130. Three stage thinking ‣Write a sample HTML or TXT file ‣Inspect Git’s status ‣Add code (stage it) ‣Commit code
  • 131. Usage Basics Diff-ing changes
  • 132. Three stage thinking What has changed that we haven’t committed?
  • 133. Three stage thinking # Show the unstaged changes $ git diff
  • 134. Three stage thinking Working Staging Repo $ git diff
  • 135. Three stage thinking # Show the staged changes $ git diff --staged
  • 136. Three stage thinking Working Staging Repo $ git diff --staged
  • 137. Three stage thinking # Show uncommitted changes $ git diff HEAD
  • 138. Three stage thinking Working Staging Repo $ git diff HEAD
  • 139. Usage Basics Limiting diff output
  • 140. Limiting Diff Output Word changes instead of entire lines?
  • 141. Limiting Diff Output git diff --color-words
  • 142. Limiting Diff Output $ git diff diff --git a/first.txt b/first.txt index cbb1543..e99dea9 100644 --- a/first.txt +++ b/first.txt @@ -1,4 +1,4 @@ -//Round the rugged rock +//Round the ragged rock $ git diff --color-words diff --git a/first.txt b/first.txt index cbb1543..e99dea9 100644 --- a/first.txt +++ b/first.txt @@ -1,4 +1,4 @@ //Round the ruggedragged rock
  • 143. Limiting Diff Output git diff --word-diff
  • 144. Limiting Diff Output $ git diff diff --git a/first.txt b/first.txt index cbb1543..e99dea9 100644 --- a/first.txt +++ b/first.txt @@ -1,4 +1,4 @@ -//Round the rugged rock +//Round the ragged rock $ git diff --word-diff diff --git a/first.txt b/first.txt index cbb1543..e99dea9 100644 --- a/first.txt +++ b/first.txt @@ -1,4 +1,4 @@ //Round the [-rugged-]{+ragged+} rock
  • 145. Usage Basics Whitespace diff
  • 146. Limiting Diff Output whitespace suppressed?
  • 147. Limiting Diff Output refactoring review
  • 148. Limiting Diff Output git diff -w
  • 149. Limiting Diff Output $ git diff diff --git a/first.txt b/first.txt index 09195c0..f2c3243 100644 --- a/first.txt +++ b/first.txt @@ -1,4 +1,4 @@ -//Foo -//Bar -//Baz + //Foo +// Bar +//Baz▊ $ git diff -w $
  • 150. Usage Basics Limiting diff by type
  • 151. Limiting Diff Output # Added (A) # Copied (C) # Deleted (D) # Modified (M) # Renamed (R) # Type changed (T) # Unmerged (U) # Unknown (X) # Pairing Broken (B) # Only show changes in added files git diff --diff-filter=A
  • 152. Limiting Diff Output # Added (A) # Copied (C) # Deleted (D) # Modified (M) # Renamed (R) # Type changed (T) # Unmerged (U) # Unknown (X) # Pairing Broken (B) # Only show changes in modified files git diff --diff-filter=M
  • 153. Limiting Diff Output # Added (A) # Copied (C) # Deleted (D) # Modified (M) # Renamed (R) # Type changed (T) # Unmerged (U) # Unknown (X) # Pairing Broken (B) # Only show changes in added or modified files git diff --diff-filter=AM
  • 154. Limiting Diff Output $ git status -s -u D README MM first.txt $ git diff --diff-filter=M diff --git a/first.txt b/first.txt index 71b55ef..14e4853 100644 --- a/first.txt +++ b/first.txt @@ -1,3 +1,3 @@ -//Foo //Bar +//Baz Only first.txt is reported
  • 155. Usage Basics Reviewing history
  • 156. Three stage thinking view history of commits
  • 157. Three stage thinking # Show all history git log
  • 158. Three stage thinking # Show all history with filenames git log --stat
  • 159. Three stage thinking # Show all history with patches git log --patch git log -p
  • 160. Three stage thinking # Limit the output entries git log -1 git log -3 git log -5
  • 161. Three stage thinking # Control the output format git log --pretty=full
  • 162. Three stage thinking # Control the output format git log --pretty=fuller
  • 163. Three stage thinking # Control the output format git log --pretty=email
  • 164. Three stage thinking # Control the output format git log --pretty=raw
  • 165. Three stage thinking # Control the output format git log --pretty=format:<pattern>
  • 166. Three stage thinking # Limit the output to added files git log --diff-filter=A
  • 167. Usage Basics+ Ignoring files
  • 168. Ignoring Files Untracked Tracked Unmodified Tracked Modified Tracked Staged Ignored commit add edit add rm ignore
  • 169. Ignoring Files suppressing files from being reported as untracked
  • 170. Ignoring Files glob patterns
  • 171. Ignoring Files $ vim .gitignore #Add glob patterns, one per line *.log *.tmp
  • 172. Ignoring Files in-memory recursive evaluation
  • 173. Ignoring Files $ vim .gitignore #Add glob patterns, one per line *.log *.tmp target output/ !special.log
  • 174. Ignoring Files ‣Ignore files via local .gitignore
  • 175. Usage Basics+ Open source .gitignores
  • 176. Open Source Ignores Preconfigured .gitignore files
  • 177. Open Source Ignores http://github.com/github/gitignore
  • 178. copy and paste(the one time it’s OK to do it)
  • 179. Usage Basics+ Global ignores
  • 180. Global Ignore Global .gitignore ?
  • 181. Global Ignore off by default
  • 182. Global Ignore $ git config --global core.excludesfile "~/.gitignore"
  • 183. Global Ignore $ vim ~/.gitignore # Operating system and editor temp files # Generally redundant over project .gitignores thumbs.db .DS_Store
  • 184. Global Ignore ‣Ignore files via global ~/.gitignore
  • 185. Usage Basics+ Removing files
  • 186. The Git File Workflow Untracked Tracked Unmodified Tracked Modified Tracked Staged Ignored commit add edit add rm ignore
  • 187. The Git File Workflow Removing Files
  • 188. The Git File Workflow # Directly remove & stage $ git rm <FILENAME>
  • 189. The Git File Workflow # Remove with OS or tool, # not integrated with Git $ rm <FILENAME> # Staging area says it is # deleted but not staged $ git status # Put deletion into staging $ git rm <FILENAME>
  • 190. The Git File Workflow # Remove with OS or tool # then follow up with git add $ rm <FILENAMES> $ git add -u .
  • 191. The Git File Workflow ‣ Remove files
  • 192. Usage Basics+ Moving files
  • 193. The Git File Workflow Untracked Tracked Unmodified Tracked Modified Tracked Staged Ignored commit add edit add rm ignore
  • 194. The Git File Workflow Moving Files
  • 195. The Git File Workflow # Directly move & stage $ git mv <FILENAME> <NEWFILENAME>
  • 196. The Git File Workflow # Move with OS or tool, mv <FILENAME> <NEWFILENAME> # Then follow up with git add git add -A .
  • 197. The Git File Workflow ‣ Rename (move) files ‣ View history of the move
  • 198. Usage Basics+ Similarity index
  • 199. Similarity Index no "move" primitive
  • 200. Similarity Index “similarity index”
  • 201. Similarity Index score of sameness
  • 202. Usage Basics+ Similarity index for moves
  • 203. Similarity Index # Move with OS or tool, $ mv <FILENAME> <NEWFILENAME> # Follow up by staging everything $ git add -A . # Renames showing git status # No renames showing? git log --stat
  • 204. why no renames in history?
  • 205. Similarity Index # Renames shown git log --stat -M
  • 206. Similarity Index ‣ Rename (move) files with changes ‣ Essentially, a refactoring workflow
  • 207. Usage Basics+ Similarity index for copies
  • 208. Similarity Index # Copies & renames shown # (superset of -M) git log --stat -C
  • 209. Similarity Index ‣Copy a file to a new filename ‣Add and commit it ‣Log it using our -C option
  • 210. “For performance reasons, by default, -C option finds copies only if the original file of the copy was modified in the same changeset. ”
  • 211. Similarity Index ‣Modify a file and copy it (in the same commit) ‣Log using the -C option
  • 212. “The --find-copies-harder flag makes the command inspect unmodified files as candidates for the source of copy. This is a very expensive operation for large projects, so use it with caution. Giving more than one -C option has the same effect. ”
  • 213. Similarity Index # Copies & renames shown # (superset of -M) git log --stat -C -C git log --stat --find-copies-harder
  • 214. Similarity Index ‣Log the same file using our -C -C option
  • 215. Usage Basics+ Similarity index for blame
  • 216. Similarity Index # File authoring shown git blame rerere.c
  • 217. Similarity Index # True source of code shown git blame rerere.c -C
  • 218. Similarity Index 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 1) #include "cache.h" c455c87c (Johannes Schindelin 2008-07-21 19:03:49 +0100 2) #include "string-list.h" 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 3) #include "rerere.h" 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 4) #include "xdiff-interface.h" dea4562b (Junio C Hamano 2009-12-25 15:51:32 -0800 5) #include "dir.h" dea4562b (Junio C Hamano 2009-12-25 15:51:32 -0800 6) #include "resolve-undo.h" dea4562b (Junio C Hamano 2009-12-25 15:51:32 -0800 7) #include "ll-merge.h" 8588567c (Junio C Hamano 2010-01-16 23:28:46 -0800 8) #include "attr.h" 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 9) ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 10) #define RESOLVED 0 ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 11) #define PUNTED 1 ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 12) #define THREE_STAGED 2 ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 13) void *RERERE_RESOLVED = &RERERE_RESOLVED; ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 14) 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 15) /* if rerere_enabled == -1, fall back to detection of .git 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 16) static int rerere_enabled = -1; 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 17) 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 18) /* automatically update cleanly resolved paths to the inde 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 19) static int rerere_autoupdate; 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 20) 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 21) static char *merge_rr_path; 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 22) 90056966 (SZEDER Gábor 2009-02-14 23:21:04 +0100 23) const char *rerere_path(const char *hex, const char *file) 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 24) { 90056966 (SZEDER Gábor 2009-02-14 23:21:04 +0100 25) return git_path("rr-cache/%s/%s", hex, file); 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 26) } 5b2fd956 (Stephan Beyer 2008-07-09 14:58:57 +0200 27)
  • 219. Similarity Index 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 1) #include "cache.h" c455c87c rerere.c (Johannes Schindelin 2008-07-21 19:03:49 +0100 2) #include "string-list.h" 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 3) #include "rerere.h" 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 4) #include "xdiff-interface.h" dea4562b rerere.c (Junio C Hamano 2009-12-25 15:51:32 -0800 5) #include "dir.h" dea4562b rerere.c (Junio C Hamano 2009-12-25 15:51:32 -0800 6) #include "resolve-undo.h" dea4562b rerere.c (Junio C Hamano 2009-12-25 15:51:32 -0800 7) #include "ll-merge.h" 8588567c rerere.c (Junio C Hamano 2010-01-16 23:28:46 -0800 8) #include "attr.h" 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 9) ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 10) #define RESOLVED 0 ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 11) #define PUNTED 1 ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 12) #define THREE_STAGED 2 ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 13) void *RERERE_RESOLVED = &RERERE_RESOLVED; ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 14) b4372ef1 builtin-rerere.c (Johannes Schindelin 2007-07-06 13:05:59 +0100 15) /* if rerere_enabled == -1, fall back to detection of .git b4372ef1 builtin-rerere.c (Johannes Schindelin 2007-07-06 13:05:59 +0100 16) static int rerere_enabled = -1; b4372ef1 builtin-rerere.c (Johannes Schindelin 2007-07-06 13:05:59 +0100 17) 121c813f builtin-rerere.c (Junio C Hamano 2008-06-22 02:04:31 -0700 18) /* automatically update cleanly resolved paths to the inde 121c813f builtin-rerere.c (Junio C Hamano 2008-06-22 02:04:31 -0700 19) static int rerere_autoupdate; 121c813f builtin-rerere.c (Junio C Hamano 2008-06-22 02:04:31 -0700 20) 658f3650 builtin-rerere.c (Johannes Schindelin 2006-12-20 17:39:41 +0100 21) static char *merge_rr_path; 658f3650 builtin-rerere.c (Johannes Schindelin 2006-12-20 17:39:41 +0100 22) 90056966 rerere.c (SZEDER Gábor 2009-02-14 23:21:04 +0100 23) const char *rerere_path(const char *hex, const char *file) 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 24) { 90056966 rerere.c (SZEDER Gábor 2009-02-14 23:21:04 +0100 25) return git_path("rr-cache/%s/%s", hex, file); 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 26) } 5b2fd956 rerere.c (Stephan Beyer 2008-07-09 14:58:57 +0200 27)
  • 220. Network Offline design
  • 221. Offline ‣Local repository is a full copy of the remote ‣Clone fetches all branches and tags ‣Almost all activities happen offline (local disk) ‣Offline activities are push-ed to remotes
  • 222. More available connectivity
  • 223. More demand to work without connectivity?
  • 224. Offline nice benefit, but wrong reason
  • 225. Offline batched network access
  • 226. Offline
  • 227. Offline Checkout a branch Add changes Commit changes Branch changes Log history Grep history Stash pending changes Tag a commit Remove a file Merge a branch Rewrite history
  • 228. Offline give up incremental revision numbers
  • 229. Offline ‣ Using every command offline
  • 230. Network Cloning protocols
  • 231. Cloning Repositories ‣Git supports many cloning protocols ‣file ‣git ‣ssh ‣http
  • 232. Cloning Repositories ‣file ‣git clone file://myrepos/project ‣git clone /myrepos/project
  • 233. Cloning Repositories ‣git ‣git clone git://server/project.git
  • 234. Cloning Repositories ‣ssh ‣ git clone git+ssh://user@server:project.git ‣ git clone user@server:project.git
  • 235. Cloning Repositories ‣http (dumb) ‣git clone http://server/project.git ‣git clone https://server/project.git
  • 236. Cloning Repositories ‣http (smart) ‣git clone http://server/project.git ‣git clone https://server/project.git
  • 237. Cloning Repositories ‣ Clone hellogitworld ‣ git clone
  • 238. Network Proxy servers
  • 239. Cloning Repositories ‣Git Configuration ‣git config --global http.proxy “<URL>”
  • 240. Network Speed
  • 241. ‣git: git ‣hg: mercurial ‣bzr: bazaar
  • 242. data from http://whygitisbetterthanx.com/#git-is-fast git svn Init git svn Status git svn Diff git svn Tag git svn Log git svn Commit (Lg) git svn Commit (Sm) git c svn c Branch Speed
  • 243. Speed ‣ Add, commit and push 1000 files
  • 244. Network Namespaces
  • 245. Namespaces Local Remote Upstream
  • 246. Namespaces #List local branches git branch
  • 247. Namespaces Local Remote Upstream
  • 248. Namespaces #List remote branches git branch -r
  • 249. Namespaces Local Remote Upstream
  • 250. Namespaces #List all branches git branch -a
  • 251. Namespaces Local Remote Upstream
  • 252. Namespaces #List upstream branches git ls-remote origin
  • 253. Namespaces Local Remote Upstream
  • 254. Network Namespace operations
  • 255. Namespaces Local Remote Upstream commit fetch push clone clone clone push pull pull pull
  • 256. Network The commit lifecycle
  • 257. Namespaces Commit Push Pull
  • 258. Namespaces ‣git commit ‣Transactionally save code snapshot ‣Commit to local branch ‣Operate on local disk
  • 259. Namespaces Commit Push Pull
  • 260. Namespaces ‣git push <remote> ‣Send code to an upstream server ‣Update remote branches
  • 261. Namespaces Commit Push Pull
  • 262. Namespaces ‣git pull <remote> ‣Retrieve upstream objects ‣Update remote branch ‣Merge changes into local branch ‣Commit the merge to the local branch
  • 263. Namespaces Local Remote Upstream commit fetch push clone clone clone push pull pull pull
  • 264. Network Remotes
  • 265. Remotes Remotes are just symbolic names
  • 266. Remotes You can have as many as you like
  • 267. Remotes The default name is origin if you’ve cloned
  • 268. Remotes Remote-tracking branches are locally immutable (conceptually)
  • 269. Remotes Local Remote Upstream
  • 270. Remotes ‣ Adding remotes ‣ Fetching from remotes (upstream)
  • 271. Network Pruning deletions
  • 272. ‣ Purge remote branches that have been removed from an upstream repository ‣git remote prune <REMOTENAME>
  • 273. Remotes ‣Deleting upstream branches ‣Pruning locally
  • 274. Architecture Plumbing and Porcelain
  • 275. Plumbing and Porcelain Command Composition
  • 276. Plumbing is the set of low level utilities Command Composition
  • 277. Porcelain is the set of end user commands Command Composition
  • 278. Porcelain is comprised of plumbing Command Composition
  • 279. Command Composition
  • 280. git-add git-am git-archive git-bisect git-branch git-bundle git- checkout git-cherry-pick git-citool git-clean git-clone git-commit git-describe git-diff git-fetch git-format-patch git-gc git-grep git- gui git-init git-log git-merge git-mv git-notes git-pull git-push git- rebase git-reset git-revert git-rm git-shortlog git-show git-stash git-status git-submodule git-tag gitk git-config git-fast-export git- fast-import git-filter-branch git-lost-found git-mergetool git-pack- refs git-prune git-reflog git-relink git-remote git-repack git-replace git-repo-config git-annotate git-blame git-cherry git-count-objects git-difftool git-fsck git-get-tar-commit-id git-help git-instaweb git- merge-tree git-rerere git-rev-parse git-show-branch git-verify-tag git-whatchanged git-archimport git-cvsexportcommit git-cvsimport git- cvsserver git-imap-send git-quiltimport git-request-pull git-send- email git-svn Porcelain git-apply git-checkout-index git-commit-tree git-hash-object git-index-pack git-merge-file git-merge-index git-mktag git-mktree git-pack-objects git-prune-packed git-read-tree git- symbolic-ref git-unpack-objects git-update-index git-update-ref git-write-tree git-cat-file git-diff-files git-diff-index git-diff-tree git-for-each-ref git-ls-files git-ls-remote git- ls-tree git-merge-base git-name-rev git-pack-redundant git-rev-list git-show-index git-show- ref git-tar-tree git-unpack-file git-var git-verify-pack git-daemon git-fetch-pack git-http- backend git-send-pack git-update-server-info git-http-fetch git-http-push git-parse-remote git-receive-pack git-shell git-upload-archive git-upload-pack git-check-attr git-check-ref- format git-fmt-merge-msg git-mailinfo git-mailsplit git-merge-one-file git-patch-id git-peek- remote git-sh-setup git-stripspace Plumbing
  • 281. pull is comprised of fetch + merge Command Composition
  • 282. checkout -b is comprised of branch + checkout Command Composition
  • 283. log HEAD is comprised of rev-parse + log Command Composition
  • 284. Aliases Command shortcuts
  • 285. Aliases ‣Shortcuts for common commands ‣Create your own recipe ‣Largely the same as shell aliases
  • 286. Aliases # Alias for status as 's' git config --global alias.s "status -u -s"
  • 287. Aliases ‣ Add an alias
  • 288. Aliases # Alias for log with file name as 'l' git config --global alias.l "log --stat -C"
  • 289. Aliases # Alias showing all branches to 'br' git config --global alias.br "branch -a"
  • 290. Aliases # Alias for commit-no-staging to 'cns' git config --global alias.cns "commit -a"
  • 291. Aliases # Alias for shell pull then push to 'sync' $ git config --global alias.sync "!git pull && git push"
  • 292. Aliases # Alias for crummy-commit-file-quick $ git config --global alias.ccfq "!sh -c 'git add $1 && git commit -m"Placeholder"' -"
  • 293. Aliases ‣ Matthew's Aliases ‣ https://github.com/matthewmccullough/git-workshop/blob/master/ workbook/examples/config/.gitconfig
  • 294. Architecture Storage
  • 295. Typical SCMs use delta storage Storage
  • 296. CVS / Subversion / darcs / Mercurial Storage
  • 297. Storage v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B Δ Δ Δ Δ ΔΔΔ
  • 298. Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Checkin Delta storage gets slower as the history of a file gets longer Storage
  • 299. Git uses DAG storage Storage
  • 300. Directed Acyclic Graph Storage
  • 301. Storage
  • 302. Copy of the entire tree per checkin Storage
  • 303. cp -r srcfolder srcfolder.prev Storage
  • 304. Why? Storage
  • 305. Storage v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  • 306. hard link to existing identical blobs Storage
  • 307. Storage v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File Cß
  • 308. zlib deflates each blob at commit Storage
  • 309. Storage v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  • 310. zlib deflates the entire repo Storage
  • 311. Storage v1 v2 v3 v4 File A File B File C File A File B File B File C v5 File A File BFile B File A File A File C File C File C
  • 312. Storage 2100 MBbecame 205 MB Act I
  • 313. Architecture Hashes
  • 314. Hashes centralized VCSs use sequential revision numbers
  • 315. Hashes Git uses a SHA-1 hash
  • 316. Hashes
  • 317. 40 hex characters (20 bytes) Hashes
  • 318. 9AB223D28B1AA46EF1780B22F304982E39872C34 Hashes
  • 319. Hashes 9AB223D28B1AA46EF1780B22F304982E39872C34 <html> <body> <p>This is a test</p> <img src="http://ai.com/icon.gif"> </body> </html> 9AB223D28B1AA46EF1780B22F304982E39872C34
  • 320. use as little of it as is unique Hashes
  • 321. Architecture Hash shortcuts
  • 322. commitish & treeish Hashes
  • 323. commitish Hashes = shorthand for commit hashes
  • 324. treeish Hashes = shorthand for tree hashes
  • 325. 9AB22F a certain commit Hashes
  • 326. 9AB22F^ one commit before a certain commit Hashes
  • 327. 9AB22F^^ two commits before a certain commit Hashes
  • 328. 9AB22F~5 five commits before a certain commit Hashes
  • 329. 9AB223..56CD77 between these two commits Hashes
  • 330. HEAD the most recent commit on this branch Hashes
  • 331. HEAD^ one commit before the most recent commit Hashes
  • 332. HEAD~2 two commits before the most recent commit Hashes
  • 333. HEAD..HEAD^^^ between the given recent commits Hashes
  • 334. master the most recent commit on this branch Hashes
  • 335. master^^ two commits before the most recent commit on this branch Hashes
  • 336. master~5 five commits before the most recent commit on this branch Hashes
  • 337. remotes/origin/master the most recent commit on this remote tracking branch Hashes
  • 338. origin/master the most recent commit on this remote tracking branch Hashes
  • 339. Hashes Navigate with commitish on commit, status, & log
  • 340. Architecture Hash relationships
  • 341. Hashes ‣Blob ‣Tree ‣Commit ‣Tag
  • 342. Hashes tree tree: 7e8b1 web blob: 9ab16 index.html a10b3 tree blob: 8d162 logo.jpg blob: 51d22 draw.js 7e8b1commit tree: a10b3 parent: nil author: Fird committer: Matthew message: Major refactoring of the web content. c67db blob<html> <body></body> </html> 9ab16 blob //Some more javascript var renderSize 51d22 blob 7D 8D B3 7F BD 12 9F E9 7B 78 9D 3F 5C A6 72 CB 8d162
  • 343. Hashes v1 v2 v3 commit tree: 9a87b parent: nil author: Fird committer: Matthew message: Major refactoring of the Javascript rendering engine. c67db commit tree: b22c1 parent: c67db author: Tim committer: Fird message: Minor update to HTML 9bd21 commit tree: b22c1 parent: 9bd21 author: Johnny committer: Joe message: New language transations 1c2d7
  • 344. Hashes RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1
  • 345. Branching Creating branches
  • 346. Branches default branch name is master
  • 347. Branches master doesn’t have any special privileges
  • 348. Branches Local Remote Upstream
  • 349. Branches # Creating a branch git branch <BRANCHNAME>
  • 350. RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1
  • 351. Hashes ‣Create a new local branch from HEAD
  • 352. Branches # Creating a branch git branch <BRANCHNAME> HEAD
  • 353. Branches # Creating a branch git branch <BRANCHNAME> <REF>
  • 354. RELEASE_1.0 HEAD bug979branch commit c67db commit 9bd21 commit 1c2d7 commit 8c2d1 commit 1bdcd commit 2daa1
  • 355. Hashes ‣Create a new local branch from a branch
  • 356. Branching Branch as experiments
  • 357. Branches What do cheap branches enable?
  • 358. Branches ‣Experimentation ‣
  • 359. Branches ‣Experimentation ‣Safe experimentation
  • 360. Branches Better reuse of units of work
  • 361. Hashes ‣Create a branch for an experiment ‣Delete the failed experiment
  • 362. Branching Branch frequency
  • 363. Branches When should you branch?
  • 364. Branches The answer is always
  • 365. Branches Branches isolate volatile work
  • 366. Branches Branches cost a mere 20 bytes
  • 367. Branches We’ve always wanted to branch often It’s just been too expensive, polluting, or ceremonious
  • 368. Hashes ‣Show branches on the Git project
  • 369. Branching Branch lifetimes
  • 370. Branches ‣Branched by lifetime ‣ Product ‣ Integration ‣ Feature ‣ Story ‣ Idea
  • 371. Branches product integration feature story idea
  • 372. product v1.0 integration story1 story2 v1.5 integration story3 Branches
  • 373. Branches Local Remote Upstream Integ Product Integ Product Integ Product
  • 374. Branches Local Remote Upstream Idea Story Feature FeatureFeature Integ Product Integ Product Integ Product
  • 375. Branches Local Remote Upstream Idea Story Feature FeatureFeature Integ Product Integ Product Integ Product
  • 376. Branches ‣Branch from the master branch ‣Merge from the topic branch ‣Destroy the topic branch
  • 377. Branching Stashes
  • 378. Stash super quick branch
  • 379. Stash local-only branch
  • 380. Stash ‣Numbered branch ‣Stack based implementation ‣Push, Peek, and Pop operations (But has direct entry access too)
  • 381. Stash creating a stash
  • 382. Stash # Stash your pending changes git stash
  • 383. Stash inspecting the stash
  • 384. Stash # List your stashes git stash list
  • 385. Stash noting the stash
  • 386. Stash # Stash your pending changes git stash save “<Message>”
  • 387. Stash # List your stashes git stash list
  • 388. Stash using the stash
  • 389. Stash # Merge & delete the latest stash git stash pop
  • 390. Stash # Merge & delete a stash git stash pop stash@{0}
  • 391. Stash # Merge & keep the latest stash git stash apply
  • 392. Branches ‣Stash modified changes ‣Stash staged changes ‣Apply stashed changes
  • 393. Stash converting a stash
  • 394. Stash # Convert a stash to a branch git stash branch <newbr>
  • 395. Stash # Convert a stash to a branch git stash branch <newbr> stash@{3}
  • 396. Branches ‣Convert a stash to a branch
  • 397. Tagging Tag uses
  • 398. tags as a first class data type
  • 399. taggingas a cheap operation
  • 400. New ways to use tags?
  • 401. Tagging ‣Tagging at each level of approval ‣Dev ‣CM ‣QA ‣Production
  • 402. Tagging Tag types
  • 403. Tagging reference, annotated and signed tag types
  • 404. Tagging Reference tag
  • 405. Tagging reference tag...
  • 406. Tagging # Tag HEAD git tag <TAGNAME>
  • 407. Tagging # Tag an existing ref git tag <TAGNAME> <REF>
  • 408. Tagging # List known tags git tag
  • 409. Tagging # Show a tag’s contents git show tag
  • 410. Tagging ‣Tag a revision ‣Start a branch from a tag
  • 411. Tagging Annotated tag
  • 412. Tagging annotated tag...
  • 413. Tagging git tag -a <TAGNAME>
  • 414. Tagging git show <TAGNAME>
  • 415. Tagging ‣Tag a revision with an annotated tag
  • 416. Tagging Signed tag
  • 417. Tagging signed tag...
  • 418. Tagging git tag -s <TAGNAME>
  • 419. Tagging git show <TAGNAME>
  • 420. Tagging ‣Tag a revision with a signed tag
  • 421. Tagging Transmitting tags
  • 422. Tagging Tags don't push by default
  • 423. Tagging # Push all tags git push <remote> <tag>
  • 424. Tagging # Push all tags git push --tags
  • 425. ‣Push a specific tag ‣Push all tags
  • 426. Tagging Tags do fetch by default
  • 427. ‣Fetch all tags
  • 428. Tagging but the refspec doesn’t say to
  • 429. ‣Inspect .git/config refspec
  • 430. Merging The basics
  • 431. Merging very traditional merge of a branch
  • 432. Merging git checkout master git merge <featurebranch>
  • 433. a32 2e2 e69 d19 8b3 Branch Master/Trunk/MainLatest Merging Recursive Merge 9f1 Mergee698b3
  • 434. strategy: recursive result: no conflicts
  • 435. a32 e69 d19 Branch Master/Trunk/MainLatest Merging Fast Forward Merge Merge
  • 436. a32 e69 d19 Master/Trunk/MainLatest Merging FF Merge
  • 437. strategy: recursive result: fast forward
  • 438. a32 2e2 e69 d19 8b3 Branch Master/Trunk/MainLatest Merging Conflicting Merge Merge 9f1 e698b3 Fix Conflict
  • 439. strategy: recursive result: conflicting
  • 440. Merging Octopus
  • 441. Merging git checkout master git merge <fb1> <fb2> <fb3>
  • 442. strategy: octopus
  • 443. Merging Subtree
  • 444. Merging git checkout master git merge -s subtree <fb1>
  • 445. Merging git checkout master git merge --squash -s subtree <fb1>
  • 446. strategy: subtree
  • 447. Tagging ‣Merge a local branch ‣Merge a remote branch
  • 448. Rebasing What is rebasing?
  • 449. rebasing is not a merge Rebasing
  • 450. rebasing is a preparation for a merge Rebasing
  • 451. Merges weave multiple old changes into a new unifying commit Rebasing
  • 452. Rebase reorders the chosen commits before your branch work Rebasing
  • 453. simulates team members taking turns working (one person at a time) Rebasing
  • 454. Rebasing Rebasing on a branch
  • 455. Rebasing git pull --rebase
  • 456. Retrieve upstream changes and relocate your local changes to the end Rebasing
  • 457. Rebasing git pull --rebase # is the same as git checkout master git rebase origin/master
  • 458. Rebasing git checkout <featurebranch> git rebase master
  • 459. a32 2e2 8b3 Master/Trunk/MainLatest Rebasing e69 d19 Branch
  • 460. a32 2e2 8b3 e69 d19 Branch Master/Trunk/MainLatest Rebase Rebasing
  • 461. a32 2e2 e69' d19' 8b3 Branch Master/Trunk/MainLatest Rebasing Rebase
  • 462. a32 2e2 e69' d19' 8b3 Branch Master/Trunk/MainLatest Merge Rebasing
  • 463. Rebasing ‣Rebase topic branch on master
  • 464. Rebasing Interactive rebasing
  • 465. Rework your work so it makes sense to the team Rebasing
  • 466. Rebasing git checkout myfeaturebranch # Replay the last 5 commits git rebase -i HEAD~5
  • 467. a32 2e2 8b3 Master/Trunk/MainLatest Rebasing e69 d19
  • 468. a32 2e2 Master/Trunk/MainLatest Rebasing e69 d19
  • 469. a32 2e2 Master/Trunk/MainLatest Rebasing e69 d19
  • 470. a32 2e2 Master/Trunk/MainLatest Rebasing e69 d19
  • 471. a32 2e2 Master/Trunk/MainLatest Rebasing e69 d19
  • 472. a32 2e2 Master/Trunk/MainLatest Rebasing e69 d19
  • 473. a32 Master/Trunk/MainLatest Rebasing e69 d19 2e2
  • 474. Rebasing ‣Interactively rebase a single branch
  • 475. Workflows Usage Models
  • 476. Usage Models Central Repo Centralized
  • 477. Usage Models Blessed Repo Dictatorship
  • 478. Usage Models Certified Repo Development Repo ntegrationManaged Continuous Integration Server
  • 479. Usage Models Custom+PublicContrib Customized PrivatePublic GitHub
  • 480. Usage Models Mirror Development Repo Mirrored Mirror Certified Repo
  • 481. Undo Clean
  • 482. Clean clean purges untracked files respects ignored and tracked
  • 483. Clean # Dry-run remove files git clean -n
  • 484. Clean # Dry-run remove files, dirs git clean -nd
  • 485. Clean # Remove files git clean -f
  • 486. Clean # Remove files, dirs git clean -fd
  • 487. Undo ‣Clean untracked files
  • 488. Clean # Also remove ignored files git clean -xf
  • 489. Clean # Also remove ignored files, dirs git clean -xdf
  • 490. Clean # Only list ignored files git clean -Xn
  • 491. Clean # Only remove ignored files git clean -Xf
  • 492. Undo ‣Clean ignored files
  • 493. Undo Revert
  • 494. Revert revert negates one or more commits
  • 495. Revert new commit at the end of HEAD
  • 496. Revert no pointer to old ref in revert commit
  • 497. Revert comment references the old one
  • 498. 8b3 ' Revert a32 2e2 d19' 8b3
  • 499. Revert a32 2e2 d19' 8b3 Revert 8b3 '
  • 500. Revert # Revert a single commit git revert <ref>
  • 501. Revert ‣Revert a single change
  • 502. Revert # Revert a range of commits git revert <ref1>..<ref2>
  • 503. Revert # Revert a range of commits git revert <old>..<new>
  • 504. Revert must have the old..new refs in the right order
  • 505. Undo Amend
  • 506. Amend amend rewrites the last commit
  • 507. Amend git commit --amend
  • 508. Amend ‣Amend a bad commit message
  • 509. Amend git add <missingfile> git commit --amend
  • 510. Amend ‣Amend a missing file
  • 511. Git-SVN Cloning
  • 512. git-svn ‣Subversion protocol bridge from Git ‣Round-trip integration ‣Transactions in Git == transactions in SVN
  • 513. git-svn # Clone one branch git svn clone <svnurl>
  • 514. git-svn # Clone all branches, tags git svn clone --stdlayout <svnurl>
  • 515. git-svn ‣Alternate conversion tool ‣ svn2git ‣ https://github.com/nirvdrum/svn2git ‣ Converts tags to Git tags
  • 516. Git-SVN Updating
  • 517. git-svn ‣Fetch new changes ‣git svn rebase
  • 518. git-svn ‣Send new changes ‣git svn dcommit
  • 519. Git-SVN SVN Externals
  • 520. git-svn ‣ SVN Externals ‣ No direct support ‣ Represented as separate repos ‣ Git points at a stable snapshot ‣ SVN Externals follow changes on a branch
  • 521. git-svn ‣Externals cloning process ‣ svn propget svn:externals <MODULE> ‣ git svn clone --stdlayout <THEURL> ‣ git submodule add <THESUBFOLDER> ‣ git submodule init ‣ git submodule update
  • 522. git-svn ‣ SVN Externals helper script ‣ https://github.com/andrep/git-svn-clone-externals
  • 523. Git FoundationsAn exploration of the Git toolbox Officialtrainingcurriculumv3.1.0©2012,GitHub,Inc.
  • 524. @matthewmccull matthew@github.com github.com/training
  • 525. Credits ‣Images sourced from: ‣ AmbientIdeasPhotography.com ‣ Hand Tools ‣ Flickr Creative Commons ‣ Clock: http://www.flickr.com/photos/7729940@N06/4019157830 ‣ Wikipedia ‣ Linus Torvalds: http://en.wikipedia.org/wiki/File:Linus_Torvalds.jpeg