Download - Github - Git Training Slides: Foundations
![Page 1: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/1.jpg)
Git FoundationsAn exploration of the Git toolbox
Offi
cial
trai
ning
cur
ricul
um v
3.1.
0©
201
2, G
itHub
, Inc
.
![Page 2: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/2.jpg)
Hello!
![Page 3: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/3.jpg)
Matthew McCullough
@matthewmccull
![Page 4: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/4.jpg)
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
![Page 5: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/5.jpg)
Welcome
‣Questions, Pacing‣Ask questions at any time. Don't wait!‣Suggest course pacing slowing/speeding up
![Page 6: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/6.jpg)
![Page 7: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/7.jpg)
![Page 8: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/8.jpg)
![Page 9: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/9.jpg)
GitWhere’s this coming from?
![Page 10: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/10.jpg)
Git
![Page 11: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/11.jpg)
Git?
Open Source
![Page 12: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/12.jpg)
Git?
bash scripts � C code
![Page 13: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/13.jpg)
Git?
≉
![Page 14: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/14.jpg)
Git-nounBritish Slang. an unpleasant
or contemptible person
-Oxford English Dictionary
“
”
![Page 15: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/15.jpg)
I'm an egotistical bastard, and I name
all my projects after myself.
First Linux, now git.-Linus Torvalds
“
”
![Page 16: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/16.jpg)
GitWhat is this thing?
![Page 17: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/17.jpg)
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. contempti
ble and despicable. simple. Take your
pick from the dictionary of
slang.* "global informati
on tracker": you're in a good mood, an
d it actually works for you.
Angels sing, and a light suddenly fill
s the room.
* "goddamn idiotic truckload of sh*t":
when it breaks
Git is a fast, scalable, distributed r
evision control system with an unusual
ly rich
command set that provides both high-le
vel operations and full access to inte
rnals.
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.
“
”
![Page 18: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/18.jpg)
file trackercontent
![Page 19: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/19.jpg)
Git?
centralized version control systems have matured
![Page 20: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/20.jpg)
CVS
Subversion
PVCS
Perforce
ClearCaseSource
Safe
RCS
Folders
Git?
![Page 21: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/21.jpg)
small improvements, but noradical innovation
Git?
![Page 22: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/22.jpg)
Linus?
Git?
![Page 23: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/23.jpg)
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
“
”
![Page 24: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/24.jpg)
VCS reboot
Git?
![Page 25: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/25.jpg)
50% Distributed Version Control
Git?
50% Git Concepts
with
![Page 26: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/26.jpg)
1997code co-op
![Page 27: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/27.jpg)
2001arch
![Page 28: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/28.jpg)
2003monotone
![Page 29: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/29.jpg)
2003SVK
![Page 30: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/30.jpg)
2003darcs
![Page 31: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/31.jpg)
2005bazaar
![Page 32: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/32.jpg)
2005mercurial
![Page 33: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/33.jpg)
2005git
![Page 34: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/34.jpg)
time to mature
![Page 35: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/35.jpg)
most unique improvements
![Page 36: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/36.jpg)
largest DVCS user base
![Page 37: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/37.jpg)
SetupTesting Git
![Page 38: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/38.jpg)
Setting up Git
Check your Git version... git --version
![Page 39: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/39.jpg)
SetupWhat is a Git install?
![Page 40: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/40.jpg)
Setting up Git
binaries on your $PATH
![Page 41: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/41.jpg)
UsingCreating a repository
![Page 42: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/42.jpg)
Creating A Repository
# Green field project$ git init newproject$ cd newproject# ...start coding
![Page 43: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/43.jpg)
Creating A Repository
‣Create our first repository
![Page 44: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/44.jpg)
Creating A Repository
or if you already have source code
![Page 45: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/45.jpg)
Creating A Repository
# Legacy project tree$ cd existingproject$ git init
# Add all the code$ git add .$ git commit -m”Initial import”
![Page 46: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/46.jpg)
UsingWhat’s in .git?
![Page 47: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/47.jpg)
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
![Page 48: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/48.jpg)
Three stage thinking
‣Explore the .git folder
![Page 49: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/49.jpg)
ConfigurationDisplay
![Page 50: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/50.jpg)
Configuring Git
Query existing configuration
![Page 51: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/51.jpg)
Configuring Git
All entries
![Page 52: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/52.jpg)
Configuring Git
#List all config valuesgit config --list
![Page 53: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/53.jpg)
Configuring Git
Single entry
![Page 54: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/54.jpg)
Configuring Git
#Query effective value of a single keygit config section.keygit config section.subsection.key
![Page 55: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/55.jpg)
Configuring Git
#Show a specific config valuegit config user.namegit config user.email
![Page 56: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/56.jpg)
ConfigurationLayers
![Page 57: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/57.jpg)
Config Targets
git config --system#Saves to /etc/gitconfig
![Page 58: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/58.jpg)
Config Targets
git config --global#Saves to ~/.gitconfig
![Page 59: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/59.jpg)
Config Targets
git config --local#Saves to .git/config
![Page 60: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/60.jpg)
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 __________
![Page 61: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/61.jpg)
Config Targets
Git configuration reading & writing
targets local by default
![Page 62: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/62.jpg)
ConfigurationInheritance
![Page 63: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/63.jpg)
Config Inheritance
Query existing configuration by layer
![Page 64: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/64.jpg)
Config Inheritance
#Query a single key in a single layergit config --<WHERE> section.keygit config --<WHERE> section.subsection.key
![Page 65: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/65.jpg)
Config Inheritance
#List all system config valuesgit config --system --list
![Page 66: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/66.jpg)
Config Inheritance
#List all global config valuesgit config --global --list
![Page 67: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/67.jpg)
Config Inheritance
#List all local config valuesgit config --local --list
![Page 68: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/68.jpg)
Config Inheritance
#List effective config valuesgit config --list
![Page 69: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/69.jpg)
ConfigurationSet user identity
![Page 70: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/70.jpg)
Set User Identity
any config at any layer
![Page 71: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/71.jpg)
Set User Identity
#List the current config git config --global user.name "Fird Birfle"git config --global user.email "[email protected]"
![Page 72: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/72.jpg)
Set User Identity
just a string
![Page 73: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/73.jpg)
Set User Identity
user identity
![Page 74: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/74.jpg)
Set User Identity
user identityauthenticationnot
![Page 75: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/75.jpg)
Set User Identity
user identityauthenticationauthorization not
![Page 76: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/76.jpg)
ConfigurationDisplay color
![Page 77: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/77.jpg)
Set Console Color
console color
![Page 78: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/78.jpg)
Set Console Color
git config --global color.ui always
![Page 79: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/79.jpg)
Set Console Color
git log \ --graph \ --decorate \ --simplify-by-decoration \ --abbrev-commit \ --date=relative \ --pretty=oneline \ --all
![Page 80: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/80.jpg)
![Page 81: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/81.jpg)
Configuring Git
git log \ --graph \ --decorate \ --simplify-by-decoration \ --abbrev-commit \ --date=relative \ --pretty=oneline \ --all \ | more
![Page 82: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/82.jpg)
![Page 83: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/83.jpg)
Set Console Color
Bleh!
![Page 84: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/84.jpg)
Set Console Color
output destination detection
![Page 85: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/85.jpg)
Set Console Color
git config --global color.ui auto
# or the identical effect with...git config --global color.ui true
![Page 86: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/86.jpg)
Set Console Color
git log \ --graph \ --decorate \ --simplify-by-decoration \ --abbrev-commit \ --date=relative \ --pretty=oneline \ --all \ | more
![Page 87: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/87.jpg)
![Page 88: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/88.jpg)
Set Console Color
when you need itColor
![Page 89: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/89.jpg)
Set Console Color
Set Console Color
only when you need itColor
![Page 90: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/90.jpg)
ConfigurationLine endings
![Page 91: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/91.jpg)
Line Endings
line endings
![Page 92: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/92.jpg)
Line Endings
VS
![Page 93: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/93.jpg)
Line Endings
VSLF
CRLF
![Page 94: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/94.jpg)
Line Endings
default is to do nothing
![Page 95: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/95.jpg)
Line Endings
http://help.github.com/dealing-with-lineendings/
![Page 96: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/96.jpg)
Line Endings
#Force files to be LF in the repo,# even on Mac/Linuxgit config --global core.autocrlf input
#Force Windows to convert to platform# on checkout and to LF on commitgit config --global core.autocrlf true
![Page 97: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/97.jpg)
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
![Page 98: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/98.jpg)
warn about conversion
![Page 99: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/99.jpg)
Line Endings
#Never complain about line ending conversiongit 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 proceedgit config --global core.safecrlf true
![Page 100: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/100.jpg)
ConfigurationSecure Sockets Host (SSH)
![Page 101: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/101.jpg)
Configuring SSH
‣Generate an ssh key pair
![Page 102: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/102.jpg)
Configuring SSH
ssh key pair
![Page 103: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/103.jpg)
Configuring SSH
$ ssh-keygen -t rsa -C”For GitHub”
![Page 104: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/104.jpg)
Configuring SSH
$ ssh-keygen -t rsa -C”For GitHub”
![Page 105: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/105.jpg)
Configuring SSH
![Page 106: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/106.jpg)
Configuring SSH
# Verify the files were created
$ cd ~/.ssh$ ls
![Page 107: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/107.jpg)
Configuring SSH
![Page 108: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/108.jpg)
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
![Page 109: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/109.jpg)
Configuring SSH
#GitHub sanity testssh -T [email protected]
> Hi matthewmccullough! You've successfully authenticated, but GitHub does not provide shell access.
![Page 110: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/110.jpg)
Configuring SSH
#GitHub sanity test with verbose SSHssh -v [email protected]
>OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009debug1: Reading configuration data /Users/mccm06/.ssh/configdebug1: Reading configuration data /etc/ssh_configdebug1: Connecting to github.com [207.97.227.239] port 22.debug1: Connection established.debug1: identity file /Users/mccm06/.ssh/identity type -1debug1: identity file /Users/mccm06/.ssh/id_rsa type 1debug1: 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:3debug1: ssh_rsa_verify: signature correct...debug1: Trying private key: /Users/mccm06/.ssh/identitydebug1: Offering public key: /Users/mccm06/.ssh/id_rsadebug1: Remote: Forced command: gerve matthewmccullough
![Page 111: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/111.jpg)
Using GitThree Stage Thinking
![Page 112: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/112.jpg)
Three stage thinking
‣Edit‣Add‣Commit
![Page 113: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/113.jpg)
Three stage thinking
Working Staging Repo
add
commit
edit
![Page 114: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/114.jpg)
Three stage thinking
![Page 115: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/115.jpg)
‣shopping cart‣put things in‣take things out‣purchase at register
![Page 116: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/116.jpg)
Three stage thinking
![Page 117: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/117.jpg)
Three stage thinking
‣database transaction‣update values‣insert rows‣delete rows‣commit transaction
![Page 118: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/118.jpg)
Three stage thinking
only one staging area
![Page 119: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/119.jpg)
Three stage thinking
Working Staging Repo
add
commit
edit
![Page 120: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/120.jpg)
SetupCommit Message Editor
![Page 121: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/121.jpg)
Commit Message Editor
![Page 122: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/122.jpg)
✓? Used the VI editor?
![Page 123: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/123.jpg)
Commit Message Editor
Iy;WQ
![Page 124: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/124.jpg)
Commit Message Editor
an alternate editor?
![Page 125: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/125.jpg)
Commit Message Editor
$EDITOR environment variable
Option 1
![Page 126: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/126.jpg)
Commit Message Editor
$ export EDITOR=<AnEditorOnYourPath>
Option 1
![Page 127: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/127.jpg)
Commit Message Editor
GitPad wraps Notepad (or $EDITOR)
Option 2
![Page 128: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/128.jpg)
Commit Message Editor
http://github.com/github/GitPad
Option 2
![Page 129: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/129.jpg)
Commit Message Editor
Run GitPad...registers & wraps Notepad as the editor
Option 2
![Page 130: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/130.jpg)
Commit Message Editor
Git-specific configuration option
Option 3
![Page 131: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/131.jpg)
Commit Message Editor
#for TextMate on Macgit config --global core.editor "mate -w"
#for Notepad2 on Windowsgit config --global core.editor "notepad2.exe"
#for emacs on Linuxgit config --global core.editor "emacs"
Option 3
![Page 132: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/132.jpg)
Commit Message Editor
Option 3
![Page 133: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/133.jpg)
Commit Message Editor
‣Toggle to alternate editor
‣Make a commit
‣Test that the new editor pops up
![Page 134: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/134.jpg)
Usage BasicsAdding & committing code
![Page 135: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/135.jpg)
Three stage thinking
$ vi first.html
$ git status$ git add first.html$ git commit -m”First commit”
![Page 136: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/136.jpg)
Three stage thinking
‣Write a sample HTML or TXT file
‣Inspect Git’s status
‣Add code (stage it)
‣Commit code
![Page 137: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/137.jpg)
Usage BasicsDiff-ing changes
![Page 138: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/138.jpg)
Three stage thinking
What has changed that we haven’t committed?
![Page 139: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/139.jpg)
Three stage thinking
# Show the unstaged changes$ git diff
![Page 140: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/140.jpg)
Three stage thinking
Working Staging Repo
$ git diff
![Page 141: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/141.jpg)
Three stage thinking
# Show the staged changes$ git diff --staged
![Page 142: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/142.jpg)
Three stage thinking
Working Staging Repo
$ git diff --staged
![Page 143: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/143.jpg)
Three stage thinking
# Show uncommitted changes$ git diff HEAD
![Page 144: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/144.jpg)
Three stage thinking
Working Staging Repo
$ git diff HEAD
![Page 145: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/145.jpg)
Usage BasicsLimiting diff output
![Page 146: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/146.jpg)
Limiting Diff Output
Word changes instead of entire lines?
![Page 147: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/147.jpg)
Limiting Diff Output
git diff --color-words
![Page 148: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/148.jpg)
Limiting Diff Output
$ git diffdiff --git a/first.txt b/first.txtindex cbb1543..e99dea9 100644--- a/first.txt+++ b/first.txt@@ -1,4 +1,4 @@-//Round the rugged rock+//Round the ragged rock
$ git diff --color-wordsdiff --git a/first.txt b/first.txtindex cbb1543..e99dea9 100644--- a/first.txt+++ b/first.txt@@ -1,4 +1,4 @@//Round the ruggedragged rock
![Page 149: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/149.jpg)
Limiting Diff Output
git diff --word-diff
![Page 150: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/150.jpg)
Limiting Diff Output
$ git diffdiff --git a/first.txt b/first.txtindex cbb1543..e99dea9 100644--- a/first.txt+++ b/first.txt@@ -1,4 +1,4 @@-//Round the rugged rock+//Round the ragged rock
$ git diff --word-diffdiff --git a/first.txt b/first.txtindex cbb1543..e99dea9 100644--- a/first.txt+++ b/first.txt@@ -1,4 +1,4 @@//Round the [-rugged-]{+ragged+} rock
![Page 151: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/151.jpg)
Usage BasicsWhitespace diff
![Page 152: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/152.jpg)
Limiting Diff Output
whitespace suppressed?
![Page 153: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/153.jpg)
Limiting Diff Output
refactoring review
![Page 154: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/154.jpg)
Limiting Diff Output
git diff -w
![Page 155: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/155.jpg)
Limiting Diff Output
$ git diffdiff --git a/first.txt b/first.txtindex 09195c0..f2c3243 100644--- a/first.txt+++ b/first.txt@@ -1,4 +1,4 @@-//Foo-//Bar-//Baz+ //Foo+// Bar+//Baz▊
$ git diff -w$
![Page 156: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/156.jpg)
Usage BasicsLimiting diff by type
![Page 157: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/157.jpg)
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 filesgit diff --diff-filter=A
![Page 158: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/158.jpg)
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 filesgit diff --diff-filter=M
![Page 159: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/159.jpg)
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 filesgit diff --diff-filter=AM
![Page 160: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/160.jpg)
Limiting Diff Output
$ git status -s -u
D READMEMM first.txt
$ git diff --diff-filter=M
diff --git a/first.txt b/first.txtindex 71b55ef..14e4853 100644--- a/first.txt+++ b/first.txt@@ -1,3 +1,3 @@-//Foo //Bar+//Baz
Only first.txt is reported
![Page 161: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/161.jpg)
Usage BasicsReviewing history
![Page 162: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/162.jpg)
Three stage thinking
view history of commits
![Page 163: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/163.jpg)
Three stage thinking
# Show all historygit log
![Page 164: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/164.jpg)
Three stage thinking
# Show all history with filenamesgit log --stat
![Page 165: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/165.jpg)
Three stage thinking
# Show all history with patchesgit log --patchgit log -p
![Page 166: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/166.jpg)
Three stage thinking
# Limit the output entriesgit log -1git log -3git log -5
![Page 167: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/167.jpg)
Three stage thinking
# Control the output formatgit log --pretty=full
![Page 168: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/168.jpg)
Three stage thinking
# Control the output formatgit log --pretty=fuller
![Page 169: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/169.jpg)
Three stage thinking
# Control the output formatgit log --pretty=email
![Page 170: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/170.jpg)
Three stage thinking
# Control the output formatgit log --pretty=raw
![Page 171: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/171.jpg)
Three stage thinking
# Control the output formatgit log --pretty=format:<pattern>
![Page 172: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/172.jpg)
Three stage thinking
# Limit the output to added filesgit log --diff-filter=A
![Page 173: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/173.jpg)
Usage Basics+Ignoring files
![Page 174: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/174.jpg)
Ignoring Files
Untracked TrackedUnmodified
TrackedModified
TrackedStaged
Ignored
commit
add
edit
add
rm
ignore
![Page 175: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/175.jpg)
Ignoring Files
suppressing files from being reported as untracked
![Page 176: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/176.jpg)
Ignoring Files
glob patterns
![Page 177: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/177.jpg)
Ignoring Files
$ vim .gitignore
#Add glob patterns, one per line*.log*.tmp
![Page 178: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/178.jpg)
Ignoring Files
in-memory recursive evaluation
![Page 179: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/179.jpg)
Ignoring Files
$ vim .gitignore
#Add glob patterns, one per line*.log*.tmptargetoutput/!special.log
![Page 180: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/180.jpg)
Ignoring Files
‣ Ignore files via local .gitignore
![Page 181: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/181.jpg)
Usage Basics+Open source .gitignores
![Page 182: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/182.jpg)
Open Source Ignores
Preconfigured .gitignore files
![Page 183: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/183.jpg)
Open Source Ignores
http://github.com/github/gitignore
![Page 184: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/184.jpg)
copy and paste(the one time it’s OK to do it)
![Page 185: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/185.jpg)
Usage Basics+Global ignores
![Page 186: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/186.jpg)
Global Ignore
Global .gitignore ?
![Page 187: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/187.jpg)
Global Ignore
off by default
![Page 188: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/188.jpg)
Global Ignore
$ git config --global core.excludesfile "~/.gitignore"
![Page 189: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/189.jpg)
Global Ignore
$ vim ~/.gitignore
# Operating system and editor temp files# Generally redundant over project .gitignoresthumbs.db.DS_Store
![Page 190: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/190.jpg)
Global Ignore
‣ Ignore files via global ~/.gitignore
![Page 191: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/191.jpg)
Usage Basics+Removing files
![Page 192: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/192.jpg)
The Git File Workflow
Untracked TrackedUnmodified
TrackedModified
TrackedStaged
Ignored
commit
add
edit
add
rm
ignore
![Page 193: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/193.jpg)
The Git File Workflow
Removing Files
![Page 194: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/194.jpg)
The Git File Workflow
# Directly remove & stage$ git rm <FILENAME>
![Page 195: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/195.jpg)
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>
![Page 196: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/196.jpg)
The Git File Workflow
# Remove with OS or tool# then follow up with git add$ rm <FILENAMES>$ git add -u .
![Page 197: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/197.jpg)
The Git File Workflow
‣ Remove files
![Page 198: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/198.jpg)
Usage Basics+Moving files
![Page 199: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/199.jpg)
The Git File Workflow
Untracked TrackedUnmodified
TrackedModified
TrackedStaged
Ignored
commit
add
edit
add
rm
ignore
![Page 200: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/200.jpg)
The Git File Workflow
Moving Files
![Page 201: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/201.jpg)
The Git File Workflow
# Directly move & stage$ git mv <FILENAME> <NEWFILENAME>
![Page 202: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/202.jpg)
The Git File Workflow
# Move with OS or tool,mv <FILENAME> <NEWFILENAME># Then follow up with git addgit add -A .
![Page 203: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/203.jpg)
The Git File Workflow
‣ Rename (move) files
‣ View history of the move
![Page 204: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/204.jpg)
Usage Basics+Similarity index
![Page 205: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/205.jpg)
Similarity Index
no "move" primitive
![Page 206: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/206.jpg)
![Page 207: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/207.jpg)
![Page 208: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/208.jpg)
Similarity Index
“similarity index”
![Page 209: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/209.jpg)
![Page 210: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/210.jpg)
Similarity Index
score of sameness
![Page 211: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/211.jpg)
Usage Basics+Similarity index for moves
![Page 212: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/212.jpg)
Similarity Index
# Move with OS or tool,$ mv <FILENAME> <NEWFILENAME>
# Follow up by staging everything$ git add -A .
# Renames showinggit status
# No renames showing?git log --stat
![Page 213: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/213.jpg)
why no renames in history?
![Page 214: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/214.jpg)
Similarity Index
# Renames showngit log --stat -M
![Page 215: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/215.jpg)
Similarity Index
‣ Rename (move) files with changes
‣ Essentially, a refactoring workflow
![Page 216: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/216.jpg)
Usage Basics+Similarity index for copies
![Page 217: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/217.jpg)
Similarity Index
# Copies & renames shown# (superset of -M)git log --stat -C
![Page 218: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/218.jpg)
Similarity Index
‣Copy a file to a new filename
‣ Add and commit it
‣ Log it using our -C option
![Page 219: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/219.jpg)
“For performance reasons, by
default, -C option finds copies only if the original file
of the copy was modified in
the same changeset. ”
![Page 220: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/220.jpg)
Similarity Index
‣Modify a file and copy it (in the same commit)
‣ Log using the -C option
![Page 221: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/221.jpg)
“ 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.”
![Page 222: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/222.jpg)
Similarity Index
# Copies & renames shown# (superset of -M)git log --stat -C -Cgit log --stat --find-copies-harder
![Page 223: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/223.jpg)
Similarity Index
‣ Log the same file using our -C -C option
![Page 224: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/224.jpg)
Usage Basics+Similarity index for blame
![Page 225: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/225.jpg)
Similarity Index
# File authoring showngit blame rerere.c
![Page 226: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/226.jpg)
Similarity Index
# True source of code showngit blame rerere.c -C
![Page 227: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/227.jpg)
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 0ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 11) #define PUNTED 1ac49f5ca (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 12) #define THREE_STAGED 2ac49f5ca (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 .git5b2fd956 (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 inde5b2fd956 (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)
![Page 228: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/228.jpg)
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 0ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 11) #define PUNTED 1ac49f5ca rerere.c (Martin von Zweigbergk 2011-02-16 05:47:44 -0500 12) #define THREE_STAGED 2ac49f5ca 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 .gitb4372ef1 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 inde121c813f 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)
![Page 229: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/229.jpg)
NetworkOffline design
![Page 230: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/230.jpg)
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
![Page 231: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/231.jpg)
More available connectivity
![Page 232: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/232.jpg)
More demand to work without connectivity?
![Page 233: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/233.jpg)
Offline
nice benefit,but wrong reason
![Page 234: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/234.jpg)
Offline
batched network access
![Page 235: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/235.jpg)
Offline
![Page 236: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/236.jpg)
Offline
Checkout a branchAdd changesCommit changesBranch changesLog historyGrep historyStash pending changesTag a commitRemove a fileMerge a branchRewrite history
![Page 237: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/237.jpg)
Offline
give up incremental revision numbers
![Page 238: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/238.jpg)
Offline
‣ Using every command offline
![Page 239: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/239.jpg)
NetworkCloning protocols
![Page 240: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/240.jpg)
Cloning Repositories
‣Git supports many cloning protocols‣file‣git‣ssh‣http
![Page 241: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/241.jpg)
Cloning Repositories
‣file‣git clone file://myrepos/project‣git clone /myrepos/project
![Page 242: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/242.jpg)
Cloning Repositories
‣git‣git clone git://server/project.git
![Page 243: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/243.jpg)
Cloning Repositories
‣ssh‣ git clone git+ssh://user@server:project.git
‣ git clone user@server:project.git
![Page 244: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/244.jpg)
Cloning Repositories
‣http (dumb)‣ git clone http://server/project.git‣ git clone https://server/project.git
![Page 245: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/245.jpg)
Cloning Repositories
‣http (smart)‣git clone http://server/project.git‣git clone https://server/project.git
![Page 246: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/246.jpg)
Cloning Repositories
‣ Clone hellogitworld
‣ git clone
![Page 247: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/247.jpg)
NetworkProxy servers
![Page 248: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/248.jpg)
Cloning Repositories
‣Git Configuration‣ git config --global http.proxy “<URL>”
![Page 249: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/249.jpg)
NetworkSpeed
![Page 250: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/250.jpg)
‣git: git‣hg: mercurial‣bzr: bazaar
![Page 251: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/251.jpg)
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
![Page 252: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/252.jpg)
Speed
‣ Add, commit and push 1000 files
![Page 253: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/253.jpg)
NetworkNamespaces
![Page 254: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/254.jpg)
Namespaces
Local Remote Upstream
![Page 255: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/255.jpg)
Namespaces
#List local branchesgit branch
![Page 256: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/256.jpg)
Namespaces
Local Remote Upstream
![Page 257: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/257.jpg)
Namespaces
#List remote branchesgit branch -r
![Page 258: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/258.jpg)
Namespaces
Local Remote Upstream
![Page 259: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/259.jpg)
Namespaces
#List all branchesgit branch -a
![Page 260: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/260.jpg)
Namespaces
Local Remote Upstream
![Page 261: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/261.jpg)
Namespaces
#List upstream branchesgit ls-remote origin
![Page 262: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/262.jpg)
Namespaces
Local Remote Upstream
![Page 263: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/263.jpg)
NetworkNamespace operations
![Page 264: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/264.jpg)
Namespaces
Local Remote Upstream
commit
fetch
push
clone clone clone
push
pull pull pull
![Page 265: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/265.jpg)
NetworkThe commit lifecycle
![Page 266: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/266.jpg)
Namespaces
Commit
Push
Pull
![Page 267: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/267.jpg)
Namespaces
‣git commit
‣ Transactionally save code snapshot‣Commit to local branch‣Operate on local disk
![Page 268: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/268.jpg)
Namespaces
Commit
Push
Pull
![Page 269: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/269.jpg)
Namespaces
‣git push <remote>
‣Send code to an upstream server‣Update remote branches
![Page 270: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/270.jpg)
Namespaces
Commit
Push
Pull
![Page 271: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/271.jpg)
Namespaces
‣git pull <remote>
‣ Retrieve upstream objects‣ Update remote branch‣Merge changes into local branch‣ Commit the merge to the local branch
![Page 272: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/272.jpg)
Namespaces
Local Remote Upstream
commit
fetch
push
clone clone clone
push
pull pull pull
![Page 273: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/273.jpg)
NetworkRemotes
![Page 274: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/274.jpg)
Remotes
Remotes are just symbolic names
![Page 275: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/275.jpg)
Remotes
You can have as many as you like
![Page 276: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/276.jpg)
Remotes
The default name is origin if you’ve cloned
![Page 277: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/277.jpg)
Remotes
Remote-tracking branches are locally immutable (conceptually)
![Page 278: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/278.jpg)
Remotes
Local Remote Upstream
![Page 279: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/279.jpg)
Remotes
‣ Adding remotes
‣ Fetching from remotes (upstream)
![Page 280: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/280.jpg)
NetworkPruning deletions
![Page 281: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/281.jpg)
‣ Purge remote branches that have been removed from an upstream repository
‣ git remote prune <REMOTENAME>
![Page 282: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/282.jpg)
Remotes
‣Deleting upstream branches
‣Pruning locally
![Page 283: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/283.jpg)
ArchitecturePlumbing and Porcelain
![Page 284: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/284.jpg)
Plumbing and Porcelain
Command Composition
![Page 285: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/285.jpg)
Plumbing is the set of low level utilities
Command Composition
![Page 286: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/286.jpg)
Porcelain is the set of end user commands
Command Composition
![Page 287: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/287.jpg)
Porcelain is comprised of plumbing
Command Composition
![Page 288: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/288.jpg)
Command Composition
![Page 289: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/289.jpg)
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-svnPo
rcel
ain
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
Plum
bing
![Page 290: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/290.jpg)
pull is comprised of fetch + merge
Command Composition
![Page 291: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/291.jpg)
checkout -b is comprised of branch + checkout
Command Composition
![Page 292: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/292.jpg)
log HEAD is comprised of rev-parse + log
Command Composition
![Page 293: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/293.jpg)
AliasesCommand shortcuts
![Page 294: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/294.jpg)
Aliases
‣Shortcuts for common commands
‣Create your own recipe
‣Largely the same as shell aliases
![Page 295: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/295.jpg)
Aliases
# Alias for status as 's'git config --global alias.s "status -u -s"
![Page 296: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/296.jpg)
Aliases
‣ Add an alias
![Page 297: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/297.jpg)
Aliases
# Alias for log with file name as 'l'git config --global alias.l "log --stat -C"
![Page 298: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/298.jpg)
Aliases
# Alias showing all branches to 'br'git config --global alias.br "branch -a"
![Page 299: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/299.jpg)
Aliases
# Alias for commit-no-staging to 'cns'git config --global alias.cns "commit -a"
![Page 300: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/300.jpg)
Aliases
# Alias for shell pull then push to 'sync'$ git config --global alias.sync "!git pull && git push"
![Page 301: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/301.jpg)
Aliases
# Alias for crummy-commit-file-quick$ git config --global alias.ccfq "!sh -c 'git add $1 && git commit -m\"Placeholder\"' -"
![Page 302: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/302.jpg)
Aliases
‣ Matthew's Aliases
‣ https://github.com/matthewmccullough/git-workshop/blob/master/workbook/examples/config/.gitconfig
![Page 303: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/303.jpg)
ArchitectureStorage
![Page 304: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/304.jpg)
Typical SCMs use delta storage
Storage
![Page 305: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/305.jpg)
CVS / Subversion / darcs / Mercurial
Storage
![Page 306: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/306.jpg)
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
Δ Δ
ΔΔ ΔΔΔ
![Page 307: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/307.jpg)
Checkin
Checkin Checkin Che
ckin
Che
ckin
Che
ckin
Che
ckin
Che
ckin
Check
in
Checkin
Checkin
Delta storage gets slower as the history of a file gets longer
Storage
![Page 308: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/308.jpg)
Git uses DAG storage
Storage
![Page 309: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/309.jpg)
Directed Acyclic Graph
Storage
![Page 310: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/310.jpg)
Storage
![Page 311: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/311.jpg)
Copy of the entire tree per checkin
Storage
![Page 312: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/312.jpg)
cp -r srcfolder srcfolder.prev
Storage
![Page 313: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/313.jpg)
Why?
Storage
![Page 314: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/314.jpg)
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
![Page 315: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/315.jpg)
hard link to existing identical blobs
Storage
![Page 316: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/316.jpg)
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ß
![Page 317: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/317.jpg)
zlib deflates each blob at commit
Storage
![Page 318: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/318.jpg)
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
![Page 319: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/319.jpg)
zlib deflates the entire repo
Storage
![Page 320: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/320.jpg)
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
![Page 321: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/321.jpg)
Storage
2100 MB became 205 MB
Act I
![Page 322: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/322.jpg)
ArchitectureHashes
![Page 323: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/323.jpg)
Hashes
centralized VCSs use sequential revision numbers
![Page 324: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/324.jpg)
Hashes
Git uses a SHA-1 hash
![Page 325: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/325.jpg)
Hashes
![Page 326: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/326.jpg)
40 hex characters (20 bytes)
Hashes
![Page 327: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/327.jpg)
9AB223D28B1AA46EF1780B22F304982E39872C34
Hashes
![Page 328: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/328.jpg)
Hashes
9AB223D28B1AA46EF1780B22F304982E39872C34
<html><body>
<p>This is a test</p><img src="http://ai.com/icon.gif">
</body></html>
9AB223D28B1AA46EF1780B22F304982E39872C34
![Page 329: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/329.jpg)
use as little of it as is unique
Hashes
![Page 330: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/330.jpg)
ArchitectureHash shortcuts
![Page 331: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/331.jpg)
commitish & treeish
Hashes
![Page 332: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/332.jpg)
commitish
Hashes
= shorthand for commit hashes
![Page 333: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/333.jpg)
treeish
Hashes
= shorthand for tree hashes
![Page 334: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/334.jpg)
9AB22Fa certain commit
Hashes
![Page 335: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/335.jpg)
9AB22F^one commit before a certain commit
Hashes
![Page 336: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/336.jpg)
9AB22F^^two commits before a certain commit
Hashes
![Page 337: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/337.jpg)
9AB22F~5five commits before a certain commit
Hashes
![Page 338: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/338.jpg)
9AB223..56CD77between these two commits
Hashes
![Page 339: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/339.jpg)
HEADthe most recent commit on this branch
Hashes
![Page 340: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/340.jpg)
HEAD^one commit before the most recent commit
Hashes
![Page 341: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/341.jpg)
HEAD~2two commits before the most recent commit
Hashes
![Page 342: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/342.jpg)
HEAD..HEAD^^^between the given recent commits
Hashes
![Page 343: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/343.jpg)
masterthe most recent commit on this branch
Hashes
![Page 344: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/344.jpg)
master^^two commits before the most recent commit on this branch
Hashes
![Page 345: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/345.jpg)
master~5five commits before the most recent commit on this branch
Hashes
![Page 346: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/346.jpg)
remotes/origin/masterthe most recent commit on this remote tracking branch
Hashes
![Page 347: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/347.jpg)
origin/masterthe most recent commit on this remote tracking branch
Hashes
![Page 348: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/348.jpg)
Hashes
Navigate with commitish oncommit, status, & log
![Page 349: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/349.jpg)
ArchitectureHash relationships
![Page 350: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/350.jpg)
Hashes
‣Blob‣Tree‣Commit‣Tag
![Page 351: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/351.jpg)
Hashes
treetree: 7e8b1 webblob: 9ab16 index.html
a10b3 treeblob: 8d162 logo.jpgblob: 51d22 draw.js
7e8b1commit
tree: a10b3parent: nilauthor: Firdcommitter: Matthewmessage:
Major refactoringof the web content.
c67db
blob<html>
<body></body></html>
9ab16
blob//Some more javascriptvar renderSize
51d22
blob7D 8D B3 7F BD 12 9F E97B 78 9D 3F 5C A6 72 CB
8d162
![Page 352: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/352.jpg)
Hashes
v1 v2 v3
committree: 9a87bparent: nilauthor: Firdcommitter: Matthewmessage:
Major refactoringof the Javascript renderingengine.
c67db
committree: b22c1parent: c67dbauthor: Timcommitter: Firdmessage:
Minor update to HTML
9bd21
committree: b22c1parent: 9bd21author: Johnnycommitter: Joemessage:
New language transations
1c2d7
![Page 353: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/353.jpg)
Hashes
RELEASE_1.0 HEAD
bug979branch
commitc67db
commit9bd21
commit1c2d7
commit8c2d1
commit1bdcd
commit2daa1
![Page 354: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/354.jpg)
BranchingCreating branches
![Page 355: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/355.jpg)
Branches
default branch name is master
![Page 356: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/356.jpg)
Branches
master doesn’t have any special privileges
![Page 357: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/357.jpg)
Branches
Local Remote Upstream
![Page 358: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/358.jpg)
Branches
# Creating a branchgit branch <BRANCHNAME>
![Page 359: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/359.jpg)
RELEASE_1.0 HEAD
bug979branch
commitc67db
commit9bd21
commit1c2d7
commit8c2d1
commit1bdcd
commit2daa1
![Page 360: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/360.jpg)
Hashes
‣Create a new local branch from HEAD
![Page 361: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/361.jpg)
Branches
# Creating a branchgit branch <BRANCHNAME> HEAD
![Page 362: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/362.jpg)
Branches
# Creating a branchgit branch <BRANCHNAME> <REF>
![Page 363: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/363.jpg)
RELEASE_1.0 HEAD
bug979branch
commitc67db
commit9bd21
commit1c2d7
commit8c2d1
commit1bdcd
commit2daa1
![Page 364: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/364.jpg)
Hashes
‣Create a new local branch from a branch
![Page 365: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/365.jpg)
BranchingBranch as experiments
![Page 366: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/366.jpg)
Branches
What do cheap branches enable?
![Page 367: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/367.jpg)
Branches
‣Experimentation
‣
![Page 368: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/368.jpg)
Branches
‣Experimentation
‣Safe experimentation
![Page 369: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/369.jpg)
Branches
Better reuse of units of work
![Page 370: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/370.jpg)
Hashes
‣Create a branch for an experiment
‣Delete the failed experiment
![Page 371: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/371.jpg)
BranchingBranch frequency
![Page 372: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/372.jpg)
Branches
When should you branch?
![Page 373: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/373.jpg)
Branches
The answer is always
![Page 374: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/374.jpg)
Branches
Branches isolate volatile work
![Page 375: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/375.jpg)
Branches
Branches cost a mere 20 bytes
![Page 376: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/376.jpg)
Branches
We’ve always wanted to branch oftenIt’s just been too expensive, polluting, or ceremonious
![Page 377: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/377.jpg)
Hashes
‣Show branches on the Git project
![Page 378: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/378.jpg)
BranchingBranch lifetimes
![Page 379: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/379.jpg)
Branches
‣Branched by lifetime‣ Product‣ Integration‣ Feature‣ Story‣ Idea
![Page 380: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/380.jpg)
Branches
product
integration
feature
story
idea
![Page 381: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/381.jpg)
product
v1.0 integration
story1 story2
v1.5 integration
story3
Branches
![Page 382: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/382.jpg)
Branches
Local Remote Upstream
Integ
Product
Integ
Product
Integ
Product
![Page 383: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/383.jpg)
Branches
Local Remote Upstream
Idea
Story
Feature FeatureFeature
Integ
Product
Integ
Product
Integ
Product
![Page 384: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/384.jpg)
Branches
Local Remote Upstream
Idea
Story
Feature FeatureFeature
Integ
Product
Integ
Product
Integ
Product
![Page 385: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/385.jpg)
Branches
‣Branch from the master branch
‣Merge from the topic branch
‣Destroy the topic branch
![Page 386: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/386.jpg)
BranchingStashes
![Page 387: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/387.jpg)
Stash
super quick branch
![Page 388: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/388.jpg)
Stash
local-only branch
![Page 389: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/389.jpg)
Stash
‣Numbered branch‣Stack based implementation‣Push, Peek, and Pop operations
(But has direct entry access too)
![Page 390: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/390.jpg)
Stash
creating a stash
![Page 391: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/391.jpg)
Stash
# Stash your pending changesgit stash
![Page 392: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/392.jpg)
Stash
inspecting the stash
![Page 393: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/393.jpg)
Stash
# List your stashesgit stash list
![Page 394: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/394.jpg)
Stash
noting the stash
![Page 395: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/395.jpg)
Stash
# Stash your pending changesgit stash save “<Message>”
![Page 396: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/396.jpg)
Stash
# List your stashesgit stash list
![Page 397: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/397.jpg)
Stash
using the stash
![Page 398: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/398.jpg)
Stash
# Merge & delete the latest stashgit stash pop
![Page 399: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/399.jpg)
Stash
# Merge & delete a stashgit stash pop stash@{0}
![Page 400: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/400.jpg)
Stash
# Merge & keep the latest stashgit stash apply
![Page 401: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/401.jpg)
Branches
‣Stash modified changes
‣Stash staged changes
‣Apply stashed changes
![Page 402: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/402.jpg)
Stash
converting a stash
![Page 403: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/403.jpg)
Stash
# Convert a stash to a branchgit stash branch <newbr>
![Page 404: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/404.jpg)
Stash
# Convert a stash to a branchgit stash branch <newbr> stash@{3}
![Page 405: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/405.jpg)
Branches
‣Convert a stash to a branch
![Page 406: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/406.jpg)
TaggingTag uses
![Page 407: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/407.jpg)
tags as a first class data type
![Page 408: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/408.jpg)
tagging as a cheap operation
![Page 409: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/409.jpg)
New ways to use tags?
![Page 410: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/410.jpg)
Tagging
‣Tagging at each level of approval‣Dev‣CM‣QA‣Production
![Page 411: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/411.jpg)
TaggingTag types
![Page 412: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/412.jpg)
Tagging
reference, annotated and signed tag types
![Page 413: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/413.jpg)
TaggingReference tag
![Page 414: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/414.jpg)
Tagging
reference tag...
![Page 415: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/415.jpg)
Tagging
# Tag HEADgit tag <TAGNAME>
![Page 416: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/416.jpg)
Tagging
# Tag an existing refgit tag <TAGNAME> <REF>
![Page 417: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/417.jpg)
Tagging
# List known tagsgit tag
![Page 418: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/418.jpg)
Tagging
# Show a tag’s contentsgit show tag
![Page 419: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/419.jpg)
![Page 420: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/420.jpg)
Tagging
‣Tag a revision
‣Start a branch from a tag
![Page 421: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/421.jpg)
TaggingAnnotated tag
![Page 422: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/422.jpg)
Tagging
annotated tag...
![Page 423: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/423.jpg)
Tagging
git tag -a <TAGNAME>
![Page 424: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/424.jpg)
![Page 425: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/425.jpg)
Tagging
git show <TAGNAME>
![Page 426: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/426.jpg)
Tagging
‣Tag a revision with an annotated tag
![Page 427: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/427.jpg)
TaggingSigned tag
![Page 428: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/428.jpg)
Tagging
signed tag...
![Page 429: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/429.jpg)
Tagging
git tag -s <TAGNAME>
![Page 430: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/430.jpg)
![Page 431: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/431.jpg)
Tagging
git show <TAGNAME>
![Page 432: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/432.jpg)
Tagging
‣Tag a revision with a signed tag
![Page 433: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/433.jpg)
TaggingTransmitting tags
![Page 434: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/434.jpg)
Tagging
Tags don't push by default
![Page 435: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/435.jpg)
Tagging
# Push all tagsgit push <remote> <tag>
![Page 436: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/436.jpg)
Tagging
# Push all tagsgit push --tags
![Page 437: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/437.jpg)
‣Push a specific tag‣Push all tags
![Page 438: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/438.jpg)
Tagging
Tags do fetch by default
![Page 439: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/439.jpg)
‣Fetch all tags
![Page 440: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/440.jpg)
Tagging
but the refspec doesn’t say to
![Page 441: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/441.jpg)
‣Inspect .git/config refspec
![Page 442: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/442.jpg)
MergingThe basics
![Page 443: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/443.jpg)
Merging
very traditional merge of a branch
![Page 444: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/444.jpg)
Merging
git checkout mastergit merge <featurebranch>
![Page 445: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/445.jpg)
a32
2e2
e69
d19
8b3
Branch
Mas
ter/T
runk
/Mai
nLat
est
Merging
Recursive
Merge
9f1 Mergee698b3
![Page 446: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/446.jpg)
strategy: recursiveresult: no conflicts
![Page 447: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/447.jpg)
a32
e69
d19
Branch
Mas
ter/T
runk
/Mai
nLat
est
Merging
Fast Forward
Merge
Merge
![Page 448: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/448.jpg)
a32
e69
d19
Mas
ter/T
runk
/Mai
nLat
est
Merging
FF
Merge
![Page 449: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/449.jpg)
strategy: recursiveresult: fast forward
![Page 450: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/450.jpg)
a32
2e2
e69
d19
8b3
Branch
Mas
ter/T
runk
/Mai
nLat
est
Merging
Conflicting
Merge
Merge
9f1e698b3
Fix Conflict
![Page 451: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/451.jpg)
strategy: recursiveresult: conflicting
![Page 452: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/452.jpg)
MergingOctopus
![Page 453: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/453.jpg)
Merging
git checkout mastergit merge <fb1> <fb2> <fb3>
![Page 454: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/454.jpg)
strategy: octopus
![Page 455: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/455.jpg)
MergingSubtree
![Page 456: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/456.jpg)
Merging
git checkout mastergit merge -s subtree <fb1>
![Page 457: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/457.jpg)
Merging
git checkout mastergit merge --squash -s subtree <fb1>
![Page 458: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/458.jpg)
strategy: subtree
![Page 459: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/459.jpg)
Tagging
‣Merge a local branch‣Merge a remote branch
![Page 460: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/460.jpg)
RebasingWhat is rebasing?
![Page 461: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/461.jpg)
rebasing is not a merge
Rebasing
![Page 462: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/462.jpg)
rebasing is a preparation for a merge
Rebasing
![Page 463: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/463.jpg)
Merges weave multiple old changes intoa new unifying commit
Rebasing
![Page 464: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/464.jpg)
Rebase reorders the chosen commits before your branch work
Rebasing
![Page 465: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/465.jpg)
simulates team members taking turns working(one person at a time)
Rebasing
![Page 466: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/466.jpg)
RebasingRebasing on a branch
![Page 467: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/467.jpg)
Rebasing
git pull --rebase
![Page 468: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/468.jpg)
Retrieve upstream changes and relocate your local changes to the end
Rebasing
![Page 469: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/469.jpg)
Rebasing
git pull --rebase
# is the same asgit checkout mastergit rebase origin/master
![Page 470: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/470.jpg)
Rebasing
git checkout <featurebranch>git rebase master
![Page 471: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/471.jpg)
a32
2e2
8b3
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
Branch
![Page 472: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/472.jpg)
a32
2e2
8b3
e69
d19
Branch
Mas
ter/
Trun
k/M
ainL
ates
t
Rebase
Rebasing
![Page 473: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/473.jpg)
a32
2e2
e69'
d19'
8b3 Branch
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
Rebase
![Page 474: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/474.jpg)
a32
2e2
e69'
d19'
8b3 Branch
Mas
ter/
Trun
k/M
ainL
ates
t
Merge
Rebasing
![Page 475: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/475.jpg)
Rebasing
‣Rebase topic branch on master
![Page 476: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/476.jpg)
RebasingInteractive rebasing
![Page 477: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/477.jpg)
Rework your work so it makes sense to the team
Rebasing
![Page 478: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/478.jpg)
Rebasing
git checkout myfeaturebranch# Replay the last 5 commitsgit rebase -i HEAD~5
![Page 479: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/479.jpg)
a32
2e2
8b3
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
![Page 480: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/480.jpg)
a32
2e2
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
![Page 481: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/481.jpg)
a32
2e2
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
![Page 482: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/482.jpg)
a32
2e2
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
![Page 483: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/483.jpg)
a32
2e2
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
![Page 484: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/484.jpg)
a32
2e2
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
![Page 485: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/485.jpg)
a32
Mas
ter/
Trun
k/M
ainL
ates
t
Rebasing
e69
d19
2e2
![Page 486: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/486.jpg)
Rebasing
‣Interactively rebase a single branch
![Page 487: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/487.jpg)
WorkflowsUsage Models
![Page 488: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/488.jpg)
Usage Models
Central Repo
Ce
nt
ra
liz
ed
![Page 489: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/489.jpg)
Usage Models
Blessed Repo
Dic
ta
to
rs
hip
![Page 490: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/490.jpg)
Usage Models
Certified Repo
Development Repo
Int
eg
ra
tio
n M
an
ag
ed
ContinuousIntegration
Server
![Page 491: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/491.jpg)
Usage Models
Cu
st
om
+ P
ub
lic
Co
nt
rib
Customized
� P
riva
te
Pub
lic �
GitHub
![Page 492: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/492.jpg)
Usage Models
Mirror
Development Repo
Mir
ro
re
d
Mirror
Certified Repo
![Page 493: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/493.jpg)
UndoClean
![Page 494: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/494.jpg)
Clean
clean purges untracked files
respects ignored and tracked
![Page 495: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/495.jpg)
Clean
# Dry-run remove filesgit clean -n
![Page 496: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/496.jpg)
Clean
# Dry-run remove files, dirsgit clean -nd
![Page 497: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/497.jpg)
Clean
# Remove filesgit clean -f
![Page 498: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/498.jpg)
Clean
# Remove files, dirsgit clean -fd
![Page 499: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/499.jpg)
Undo
‣Clean untracked files
![Page 500: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/500.jpg)
Clean
# Also remove ignored files
git clean -xf
![Page 501: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/501.jpg)
Clean
# Also remove ignored files, dirs
git clean -xdf
![Page 502: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/502.jpg)
Clean
# Only list ignored files
git clean -Xn
![Page 503: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/503.jpg)
Clean
# Only remove ignored files
git clean -Xf
![Page 504: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/504.jpg)
Undo
‣Clean ignored files
![Page 505: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/505.jpg)
UndoRevert
![Page 506: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/506.jpg)
Revert
revert negates one or more commits
![Page 507: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/507.jpg)
Revert
new commit at the end of HEAD
![Page 508: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/508.jpg)
Revert
no pointer to old ref in revert commit
![Page 509: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/509.jpg)
Revert
comment references the old one
![Page 510: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/510.jpg)
8b3 '
Revert
a32
2e2
d19'
8b3
![Page 511: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/511.jpg)
Revert
a32
2e2
d19'
8b3
Revert
8b3 '
![Page 512: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/512.jpg)
Revert
# Revert a single commitgit revert <ref>
![Page 513: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/513.jpg)
Revert
‣Revert a single change
![Page 514: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/514.jpg)
Revert
# Revert a range of commitsgit revert <ref1>..<ref2>
![Page 515: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/515.jpg)
Revert
# Revert a range of commitsgit revert <old>..<new>
![Page 516: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/516.jpg)
Revert
must have the old..new refs
in the right order
![Page 517: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/517.jpg)
UndoAmend
![Page 518: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/518.jpg)
Amend
amend rewrites the last commit
![Page 519: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/519.jpg)
Amend
git commit --amend
![Page 520: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/520.jpg)
Amend
‣Amend a bad commit message
![Page 521: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/521.jpg)
Amend
git add <missingfile>git commit --amend
![Page 522: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/522.jpg)
Amend
‣Amend a missing file
![Page 523: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/523.jpg)
Git-SVNCloning
![Page 524: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/524.jpg)
git-svn
‣Subversion protocol bridge from Git
‣Round-trip integration
‣Transactions in Git == transactions in SVN
![Page 525: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/525.jpg)
git-svn
# Clone one branchgit svn clone <svnurl>
![Page 526: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/526.jpg)
git-svn
# Clone all branches, tagsgit svn clone --stdlayout <svnurl>
![Page 527: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/527.jpg)
git-svn
‣ Alternate conversion tool‣ svn2git
‣ https://github.com/nirvdrum/svn2git
‣ Converts tags to Git tags
![Page 528: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/528.jpg)
Git-SVNUpdating
![Page 529: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/529.jpg)
git-svn
‣Fetch new changes‣git svn rebase
![Page 530: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/530.jpg)
git-svn
‣Send new changes‣git svn dcommit
![Page 531: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/531.jpg)
Git-SVNSVN Externals
![Page 532: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/532.jpg)
git-svn
‣ SVN Externals
‣ No direct support
‣ Represented as separate repos
‣ Git points at a stable snapshot
‣ SVN Externals follow changes on a branch
![Page 533: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/533.jpg)
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
![Page 534: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/534.jpg)
git-svn
‣ SVN Externals helper script
‣ https://github.com/andrep/git-svn-clone-externals
![Page 535: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/535.jpg)
Git FoundationsAn exploration of the Git toolbox
Offi
cial
trai
ning
cur
ricul
um v
3.1.
0©
201
2, G
itHub
, Inc
.
![Page 536: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/536.jpg)
@matthewmccull
github.com/training
![Page 537: Github - Git Training Slides: Foundations](https://reader033.vdocuments.net/reader033/viewer/2022052310/5549a198b4c9050c708b4f43/html5/thumbnails/537.jpg)
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