git the basics - cvut.cz · merging rebasing remotes gui to ols lo ose ends-git the basics ba rt t...
TRANSCRIPT
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-Git the basi sBart Trojanowski, bart�jukie.netJukie Networks In .July 9th, 2008
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Next...Con eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con epts◮ Sour e Control Management
◮ tra k hanges to �les◮ repository / database of hanges◮ working dire tory / urrent state
◮ Centralized SCM◮ server: single database◮ lient: working dire tory & state
◮ De entralized SCM◮ anyone an be a server◮ repository oupled with working dire tory◮ omplete history◮ dis onne ted operation
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con epts◮ Sour e Control Management
◮ tra k hanges to �les◮ repository / database of hanges◮ working dire tory / urrent state
◮ Centralized SCM◮ server: single database◮ lient: working dire tory & state
◮ De entralized SCM◮ anyone an be a server◮ repository oupled with working dire tory◮ omplete history◮ dis onne ted operation
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con epts◮ Sour e Control Management
◮ tra k hanges to �les◮ repository / database of hanges◮ working dire tory / urrent state
◮ Centralized SCM◮ server: single database◮ lient: working dire tory & state
◮ De entralized SCM◮ anyone an be a server◮ repository oupled with working dire tory◮ omplete history◮ dis onne ted operation
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsWorking tree◮ dire tories◮ �les
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsRepository ontents◮ �les
a.cv1
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsRepository ontents◮ �les◮ ommits
a.cv1
b.cv9
metadata
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsRepository ontents◮ �les◮ ommits◮ an estry
A
B C
E
tim
e
D
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsdire ted a y li graph�DAG�
A
B C
D
EG
F
H
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsReferen es◮ tags
A v1.4.4
B C
D
E
v1.5.0
G
F
H
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsReferen es◮ tags◮ bran hes
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsHEAD◮ urrent he kout◮ points to bran h
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsHEAD◮ urrent he kout◮ points to bran h◮ sometimes deta hed
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM omponentsIndex◮ �staging area�◮ what is to be ommitted
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
index
HEAD
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM operationsBootstrap◮ init◮ he kout◮ swit h bran hModify◮ add, delete, rename◮ ommitInformation◮ status◮ di�◮ logReferen e◮ tag◮ bran h
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM operationsBootstrap◮ init◮ he kout◮ swit h bran hModify◮ add, delete, rename◮ ommitInformation◮ status◮ di�◮ logReferen e◮ tag◮ bran h
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM operationsBootstrap◮ init◮ he kout◮ swit h bran hModify◮ add, delete, rename◮ ommitInformation◮ status◮ di�◮ logReferen e◮ tag◮ bran h
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
SCM operationsBootstrap◮ init◮ he kout◮ swit h bran hModify◮ add, delete, rename◮ ommitInformation◮ status◮ di�◮ logReferen e◮ tag◮ bran h
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Centralized SCM
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
diff
log
update
checkout
commit
◮ operations require server◮ single point of failure◮ bottlene k
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
more SCM operationsDe entralized
◮ lone◮ pull, fet h◮ push
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralized SCMpull
pushA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
clone
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
A v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
pull
push
clo
ne
pull
pushclo
ne
◮ anyone an be a server
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralizationupstream
◮ publi repository
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralizationupstream
local
◮ make a lo al lone
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralizationupstream
pristine
topic Atopic B
◮ lo al loning is lighweight
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralizationupstream
pristine
topic Atopic B
◮ push hanges between any repositories
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralizationupstream web server
pristine
topic Atopic B
◮ publish hanges to publi server
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
De entralizationupstream web server
pristine
topic Atopic B
another
◮ share hanges with trusted peers
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Is De entralization any good?◮ non-intrusive mi ro- ommits◮ deta hed operation◮ no single point of failure◮ ba kups are trivial
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Next...Con eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Birth of GIT◮ 2002
◮ Linus uses BitKeeper for tra king Linux◮ BK gets better◮ Linux development s ales better
◮ April 6, 2005◮ BitMover drops free li ense◮ Linus writes his own SCM, GIT
◮ April 18, 2005◮ GIT an merge
◮ June 16, 2005◮ GIT is o� ially used to tra k Linux
◮ Feb 14, 2007◮ GIT 1.5.0 is released◮ major usability e�ort
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Birth of GIT◮ 2002
◮ Linus uses BitKeeper for tra king Linux◮ BK gets better◮ Linux development s ales better
◮ April 6, 2005◮ BitMover drops free li ense◮ Linus writes his own SCM, GIT
◮ April 18, 2005◮ GIT an merge
◮ June 16, 2005◮ GIT is o� ially used to tra k Linux
◮ Feb 14, 2007◮ GIT 1.5.0 is released◮ major usability e�ort
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Birth of GIT◮ 2002
◮ Linus uses BitKeeper for tra king Linux◮ BK gets better◮ Linux development s ales better
◮ April 6, 2005◮ BitMover drops free li ense◮ Linus writes his own SCM, GIT
◮ April 18, 2005◮ GIT an merge
◮ June 16, 2005◮ GIT is o� ially used to tra k Linux
◮ Feb 14, 2007◮ GIT 1.5.0 is released◮ major usability e�ort
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Birth of GIT◮ 2002
◮ Linus uses BitKeeper for tra king Linux◮ BK gets better◮ Linux development s ales better
◮ April 6, 2005◮ BitMover drops free li ense◮ Linus writes his own SCM, GIT
◮ April 18, 2005◮ GIT an merge
◮ June 16, 2005◮ GIT is o� ially used to tra k Linux
◮ Feb 14, 2007◮ GIT 1.5.0 is released◮ major usability e�ort
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Birth of GIT◮ 2002
◮ Linus uses BitKeeper for tra king Linux◮ BK gets better◮ Linux development s ales better
◮ April 6, 2005◮ BitMover drops free li ense◮ Linus writes his own SCM, GIT
◮ April 18, 2005◮ GIT an merge
◮ June 16, 2005◮ GIT is o� ially used to tra k Linux
◮ Feb 14, 2007◮ GIT 1.5.0 is released◮ major usability e�ort
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
GIT gets betterAnd then realize that nothing is perfe t. Git is just* loser* to perfe t than any other SCM out there.-Linus
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Next...Con eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository
the history
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository index100644 20b024 0 bar100644 1d52a6 0 baz100644 20b024 0 sub/fi100644 43dbe0 0 sub/foo
staging area
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository index work tree100644 20b024 0 bar100644 1d52a6 0 baz100644 20b024 0 sub/fi100644 43dbe0 0 sub/foo
.|−− bar|−− baz‘−− sub |−− fi ‘−− foo
�les you edit
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository index work tree100644 20b024 0 bar100644 1d52a6 0 baz100644 20b024 0 sub/fi100644 43dbe0 0 sub/foo
.|−− bar|−− baz‘−− sub |−− fi ‘−− foo
�staging�addremoverename
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository index work tree100644 20b024 0 bar100644 1d52a6 0 baz100644 20b024 0 sub/fi100644 43dbe0 0 sub/foo
.|−− bar|−− baz‘−− sub |−− fi ‘−− foo
� ommitting� ommit
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository index work tree100644 20b024 0 bar100644 1d52a6 0 baz100644 20b024 0 sub/fi100644 43dbe0 0 sub/foo
.|−− bar|−− baz‘−− sub |−− fi ‘−− foo
�reading tree� he koutread-treereset
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stru tureA v1.4.4
B C
D
E
v1.5.0
G
F
testing
release
topicA
H
HEAD
repository index work tree100644 20b024 0 bar100644 1d52a6 0 baz100644 20b024 0 sub/fi100644 43dbe0 0 sub/foo
.|−− bar|−− baz‘−− sub |−− fi ‘−− foo
� he king out� he kout he kout-indexreset
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
The repository.git|-- HEAD urrent he kout referen e|-- onfig repo private on�g|-- des ription repo des ription|-- hooks| `-- ... hooking s ripts|-- index hanges to ommit|-- info| |-- ex lude repo private| `-- refs refs?|-- logs| `-- ... �re�og� data|-- obje ts| |-- XX| | `-- ... loose obje ts| |-- info| | `-- pa ks info about pa ks| `-- pa k| `-- ... pa ks and indexes`-- refs|-- heads| `-- master master bran h`-- tags`-- ... tags
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
The repository.git/ onfig◮ repository on�g.git/des ription◮ des ribes the repositoryuseful for gitweb.git/info/ex lude◮ patterns to ignore
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
The repository.git/ onfig◮ repository on�g.git/des ription◮ des ribes the repositoryuseful for gitweb.git/info/ex lude◮ patterns to ignore
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
The repository.git/ onfig◮ repository on�g.git/des ription◮ des ribes the repositoryuseful for gitweb.git/info/ex lude◮ patterns to ignore
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts.git/obje ts|-- 23| `-- d4bd826aba9e29aaa e9411 175b784ed 399|-- 76| `-- 49f82d40a98b1ba59057798e47aab2a99a11d3|-- 4| `-- aaefaa8a48ad4ad379d 1002b78f1a3e4 eab |-- e7| `-- 4be61128eef713459 a4e32398d689fe80864e|-- info| `-- pa ks`-- pa k|-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .idx`-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .pa k
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts.git/obje ts|-- 23| `-- d4bd826aba9e29aaa e9411 175b784ed 399|-- 76| `-- 49f82d40a98b1ba59057798e47aab2a99a11d3|-- 4| `-- aaefaa8a48ad4ad379d 1002b78f1a3e4 eab |-- e7| `-- 4be61128eef713459 a4e32398d689fe80864e|-- info| `-- pa ks`-- pa k|-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .idx`-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .pa k�loose obje ts�
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts.git/obje ts|-- 23| `-- d4bd826aba9e29aaa e9411 175b784ed 399|-- 76| `-- 49f82d40a98b1ba59057798e47aab2a99a11d3|-- 4| `-- aaefaa8a48ad4ad379d 1002b78f1a3e4 eab |-- e7| `-- 4be61128eef713459 a4e32398d689fe80864e|-- info| `-- pa ks`-- pa k|-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .idx`-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .pa k�pa k �le�
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts ontent addressabletype size
data
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts ontent addressabletype size
data
SHA1
52a0ff44aba8599f43a5d821c421af316cb7305
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts ontent addressabletype size
data
52a0ff44aba8599f43a5d821c421af316cb7305
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts ontent addressabletype size
data
52a0ff44aba8599f43a5d821c421af316cb7305
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs
"blob" size
file data
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees "tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"tree" size
040000 blob 257cc5... other
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees "tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees "tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees◮ ommits "commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees◮ ommits "commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees◮ ommits "commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje ts4 types◮ blobs◮ trees◮ ommits◮ tags "tag" size
object cad6ae...
type commit
tag tag−name
tagger Who <address> + date
tag message
"commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
"commit" size
tree cad6ae...
parent 6f0104...
author Someone <address>
comitter Another <address>
commit message
"tree" size
040000 blob 257cc5... other
"blob" size
file dat
"blob" size
file dat
"tree" size
040000 tree 205f6b... somedir
100644 blob 9daeaf... somefil
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje tsimmutabletype size
data
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje tsimmutabletype size
data
type size
data’
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje tsimmutabletype size
data
type size
data’
SHA1
8a9fd66b8bb939638564ebfdecc23b5d58070fc8
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Next...Con eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git ommands$ git <options> < ommand> <options>
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git ommands (137)add fast-export merge-one-file revertam fast-import merge-resolve rmannotate fet h merge-subtree send-emailapply fet h-pa k merge-tree send-pa kar himport filter-bran h mergetool sh-setupar hive fmt-merge-msg mktag shellbise t for-ea h-ref mktree shortlogblame format-pat h mv showbran h fs k name-rev show-bran hbundle fs k-obje ts pa k-obje ts show-index at-file g pa k-redundant show-ref he k-attr get-tar- ommit-id pa k-refs stash he k-ref-format grep parse-remote status he kout gui pat h-id stripspa e he kout-index hash-obje t peek-remote submodule herry http-fet h prune svn herry-pi k http-push prune-pa ked symboli -ref itool imap-send pull tag lean index-pa k push tar-tree lone init quiltimport unpa k-file ommit init-db read-tree unpa k-obje ts ommit-tree instaweb rebase update-index onfig log re eive-pa k update-ref ount-obje ts lost-found reflog update-server-info vsexport ommit ls-files relink upload-ar hive vsimport ls-remote remote upload-pa k vsserver ls-tree repa k vardaemon mailinfo repo- onfig verify-pa kdes ribe mailsplit request-pull verify-tagdiff merge rerere what hangeddiff-files merge-base reset write-treediff-index merge-file rev-listdiff-tree merge-index rev-parse gitk
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Every day use. . .add fast-export merge-one-file revertam fast-import merge-resolve rmannotate fet h merge-subtree send-emailapply fet h-pa k merge-tree send-pa kar himport filter-bran h mergetool sh-setupar hive fmt-merge-msg mktag shellbise t for-ea h-ref mktree shortlogblame format-pat h mv showbran h fs k name-rev show-bran hbundle fs k-obje ts pa k-obje ts show-index at-file g pa k-redundant show-ref he k-attr get-tar- ommit-id pa k-refs stash he k-ref-format grep parse-remote status he kout gui pat h-id stripspa e he kout-index hash-obje t peek-remote submodule herry http-fet h prune svn herry-pi k http-push prune-pa ked symboli -ref itool imap-send pull tag lean index-pa k push tar-tree lone init quiltimport unpa k-file ommit init-db read-tree unpa k-obje ts ommit-tree instaweb rebase update-index onfig log re eive-pa k update-ref ount-obje ts lost-found reflog update-server-info vsexport ommit ls-files relink upload-ar hive vsimport ls-remote remote upload-pa k vsserver ls-tree repa k vardaemon mailinfo repo- onfig verify-pa kdes ribe mailsplit request-pull verify-tagdiff merge rerere what hangeddiff-files merge-base reset write-treediff-index merge-file rev-listdiff-tree merge-index rev-parse gitk
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Some GUI tools. . .add fast-export merge-one-file revertam fast-import merge-resolve rmannotate fet h merge-subtree send-emailapply fet h-pa k merge-tree send-pa kar himport filter-bran h mergetool sh-setupar hive fmt-merge-msg mktag shellbise t for-ea h-ref mktree shortlogblame format-pat h mv showbran h fs k name-rev show-bran hbundle fs k-obje ts pa k-obje ts show-index at-file g pa k-redundant show-ref he k-attr get-tar- ommit-id pa k-refs stash he k-ref-format grep parse-remote status he kout gui pat h-id stripspa e he kout-index hash-obje t peek-remote submodule herry http-fet h prune svn herry-pi k http-push prune-pa ked symboli -ref itool imap-send pull tag lean index-pa k push tar-tree lone init quiltimport unpa k-file ommit init-db read-tree unpa k-obje ts ommit-tree instaweb rebase update-index onfig log re eive-pa k update-ref ount-obje ts lost-found reflog update-server-info vsexport ommit ls-files relink upload-ar hive vsimport ls-remote remote upload-pa k vsserver ls-tree repa k vardaemon mailinfo repo- onfig verify-pa kdes ribe mailsplit request-pull verify-tagdiff merge rerere what hangeddiff-files merge-base reset write-treediff-index merge-file rev-listdiff-tree merge-index rev-parse gitk
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
O asional use. . .add fast-export merge-one-file revertam fast-import merge-resolve rmannotate fet h merge-subtree send-emailapply fet h-pa k merge-tree send-pa kar himport filter-bran h mergetool sh-setupar hive fmt-merge-msg mktag shellbise t for-ea h-ref mktree shortlogblame format-pat h mv showbran h fs k name-rev show-bran hbundle fs k-obje ts pa k-obje ts show-index at-file g pa k-redundant show-ref he k-attr get-tar- ommit-id pa k-refs stash he k-ref-format grep parse-remote status he kout gui pat h-id stripspa e he kout-index hash-obje t peek-remote submodule herry http-fet h prune svn herry-pi k http-push prune-pa ked symboli -ref itool imap-send pull tag lean index-pa k push tar-tree lone init quiltimport unpa k-file ommit init-db read-tree unpa k-obje ts ommit-tree instaweb rebase update-index onfig log re eive-pa k update-ref ount-obje ts lost-found reflog update-server-info vsexport ommit ls-files relink upload-ar hive vsimport ls-remote remote upload-pa k vsserver ls-tree repa k vardaemon mailinfo repo- onfig verify-pa kdes ribe mailsplit request-pull verify-tagdiff merge rerere what hangeddiff-files merge-base reset write-treediff-index merge-file rev-listdiff-tree merge-index rev-parse gitk
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
And the plumbing. . .add fast-export merge-one-file revertam fast-import merge-resolve rmannotate fet h merge-subtree send-emailapply fet h-pa k merge-tree send-pa kar himport filter-bran h mergetool sh-setupar hive fmt-merge-msg mktag shellbise t for-ea h-ref mktree shortlogblame format-pat h mv showbran h fs k name-rev show-bran hbundle fs k-obje ts pa k-obje ts show-index at-file g pa k-redundant show-ref he k-attr get-tar- ommit-id pa k-refs stash he k-ref-format grep parse-remote status he kout gui pat h-id stripspa e he kout-index hash-obje t peek-remote submodule herry http-fet h prune svn herry-pi k http-push prune-pa ked symboli -ref itool imap-send pull tag lean index-pa k push tar-tree lone init quiltimport unpa k-file ommit init-db read-tree unpa k-obje ts ommit-tree instaweb rebase update-index onfig log re eive-pa k update-ref ount-obje ts lost-found reflog update-server-info vsexport ommit ls-files relink upload-ar hive vsimport ls-remote remote upload-pa k vsserver ls-tree repa k vardaemon mailinfo repo- onfig verify-pa kdes ribe mailsplit request-pull verify-tagdiff merge rerere what hangeddiff-files merge-base reset write-treediff-index merge-file rev-listdiff-tree merge-index rev-parse gitk
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Helpgit help◮ list of ommon ommandsgit < ommand> -h◮ brief help outputman git-< ommand>git help < ommand>git < ommand> --help◮ manual page
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Helpgit help◮ list of ommon ommandsgit < ommand> -h◮ brief help outputman git-< ommand>git help < ommand>git < ommand> --help◮ manual page
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Helpgit help◮ list of ommon ommandsgit < ommand> -h◮ brief help outputman git-< ommand>git help < ommand>git < ommand> --help◮ manual page
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con�guration$HOME/.git onfig$ git onfig --global user.name "Your Name"$ git onfig --global user.email you�domain.tld$ git onfig --global olor.pager true$ git onfig --global olor.ui auto
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con�guration$HOME/.git onfig$ git onfig --global user.name "Your Name"$ git onfig --global user.email you�domain.tld$ git onfig --global olor.pager true$ git onfig --global olor.ui auto
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con�guration$HOME/.git onfig$ git onfig --global user.name "Your Name"$ git onfig --global user.email you�domain.tld$ git onfig --global olor.pager true$ git onfig --global olor.ui auto
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Con�guration$ at .git onfig[user℄ name = "Bart Trojanowski"email = "bart�jukie.net"signingkey = 2289688F[ ore℄ pager = less -FRSXeditor = vim[ olor℄ ui = auto[merge℄ tool = vimdiff
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Bootstrapping$ git init
◮ ran in proje t workspa e◮ reates .git dire tory
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
StagingWhat to ommit?◮ additions$ git add file$ git add .◮ removal$ git rm file◮ renames$ git mv old new
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
StagingWhat to ommit?◮ additions$ git add file$ git add .◮ removal$ git rm file◮ renames$ git mv old new
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
StagingWhat to ommit?◮ additions$ git add file$ git add .◮ removal$ git rm file◮ renames$ git mv old new
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
StagingWhat to ommit?◮ additions$ git add file$ git add .◮ removal$ git rm file◮ renames$ git mv old new
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Staging$ at .gitignore*.o*~
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Committing$ git ommit -a -m�some omment�
◮ will reate a ommit of all or only staged items
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Bootstrapping$ mkdir proje t$ d proje t$ git initworking tree
repository
.git
master
HEAD
index
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
First ommit$ e ho test > test
working tree
repository
.git
master
HEAD
index
test
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stage$ e ho test > test$ git add testworking tree
repository
.git
master
HEAD
index
test
tree
52a266...
blob
9daefb... "test"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Commit$ e ho test > test$ git add test$ git ommit -m�test�Created initial ommit 6f01040: test1 files hanged, 1 insertions(+),0 deletions(-) reate mode 100644 testworking tree
repository
.git
master
HEAD
commit
6f0104...
index
test
tree
52a266...
blob
9daefb... "test"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stage another$ e ho test > test$ git add test$ git ommit -m�test�$ mkdir dir$ e ho foo > dir/foo$ git add dir/fooworking tree
repository
.git
master
HEAD
commit
6f0104...
index
test
tree
52a266...
blob
9daefb...
tree
cad6ae...
blob
257cc5...
tree
205f6b...
dir/foo
"test"
"dir"
"foo"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Commit another$ e ho test > test$ git add test$ git ommit -m�test�$ mkdir dir$ e ho foo > dir/foo$ git add dir/foo$ git ommit -m�foo�Created ommit 52a0ff4: foo1 files hanged, 1 insertions(+),0 deletions(-) reate mode 100644 dir/foo working tree
repository
.git
master
HEAD
commit
6f0104...
index
test
tree
52a266...
blob
9daefb...
tree
cad6ae...
blob
257cc5...
tree
205f6b...
commit
52a0ff..
dir/foo
"test"
"dir"
"foo"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Repository status$ git statusshows. . .
◮ staged◮ unstaged◮ untra ked
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Di�s$ git diff◮ hanges between index and working �les$ git diff --staged◮ hanges between HEAD and index$ git diff HEAD◮ hanges between HEAD and working �les$ git diff $ ommit $ ommit◮ hanges between two ommits
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Di�s$ git diff◮ hanges between index and working �les$ git diff --staged◮ hanges between HEAD and index$ git diff HEAD◮ hanges between HEAD and working �les$ git diff $ ommit $ ommit◮ hanges between two ommits
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Di�s$ git diff◮ hanges between index and working �les$ git diff --staged◮ hanges between HEAD and index$ git diff HEAD◮ hanges between HEAD and working �les$ git diff $ ommit $ ommit◮ hanges between two ommits
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Di�s$ git diff◮ hanges between index and working �les$ git diff --staged◮ hanges between HEAD and index$ git diff HEAD◮ hanges between HEAD and working �les$ git diff $ ommit $ ommit◮ hanges between two ommits
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen esspe i� ommit ID. . .full hash 6bb1270ffb60 bfef87266d2d4b4abe4218d9 68short hash 6bb127tag v1.5.6.1lo al bran h masterremote bran h origin/masterby message �:/some text� he kout HEADlast fet h FETCH_HEADprevious head ORIG_HEAD. . .
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen esa ommit before HEADHEAD^ == HEAD~1
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen esfew ommits before HEADHEAD^^^ == HEAD~3
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen esfew ommits before mastermaster^^^ == master~3
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen eswhat was it yesterday?�{yesterday} == HEAD�{yesterday}
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen eshow about my-other-bran h on June 1st?my-other-bran h�{June.1}
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Obje t referen esmaster a few hanges ago?master�{3}
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Show me!review last ommit. . .$ git show ommit 83b2d051814e884a8e264127ed47552a5d f6 1dAuthor: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 21:44:39 2008 -0400 hanged one linediff --git a/test b/testindex 808a2 4..99810fa 100644--- a/test+++ b/test�� -1,3 +1,3 ��Some old text before the hange.-Some text for removal.+Repla ement line.Some old text after the hange.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Show me!just the stats. . .$ git show --stat ommit 83b2d051814e884a8e264127ed47552a5d f6 1dAuthor: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 21:44:39 2008 -0400 hanged one linetest | 2 +-1 files hanged, 1 insertions(+), 1 deletions(-)
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Show me!SVN'esq status information. . .$ git show --name-status ommit 3d3d2989b817af3fd4fa6d63f200113bd6 94bdbAuthor: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 22:59:13 2008 -0400something more interestingA sub/barD sub/fooM test
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Show me!review any other ommit. . .$ git show HEAD$ git show HEAD^^^$ git show master~10$ git show master�{May.16}. . .
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Show me!show a �le (or tree) in history. . .$ git show HEAD:file ontents...
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
LogsSee ommit history. . .$ git log ommit 3d3d2989b817af3fd4fa6d63f200113bd6 94bdbAuthor: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 22:59:13 2008 -0400most re ent ommit ommit 83b2d051814e884a8e264127ed47552a5d f6 1dAuthor: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 21:44:39 2008 -0400se ond most re ent ommit 1 1b35a611 39f49842e2 a28d40886 1ae9b7 Author: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 21:44:05 2008 -0400middle ommit ommit 411515f51a78d66a27a7d56ebe9f70dbd2bff008Author: Bart Trojanowski <bart�jukie.net>Date: Thu Jul 3 21:43:36 2008 -0400se ond oldest ommit 52a0ff44aba8599f43a5d821 421af316 b73051Author: Bart Trojanowski <bart�jukie.net>Date: Mon Jun 30 21:44:55 2008 -0400oldest ommit. . .
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Logsgit log is awesome!
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Logslimit by range. . .$ git log tag..bran h$ git log HEAD~10..$ git log bran h1 bran h2 ^ ommon$ git log -10$ git log -10 master�{yesterday}$ git log --sin e="May 1" --until="June 1"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Logslimit by ommit attributes. . .$ git log --author=fred$ git log -- ommitter=joe$ git log --grep=" ommit.*message.*text"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Logssear h for a hange. . .$ git log -S"some ode hange"$ git log --pi kaxe-regex -S"some.* ode.* hange"
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Logslimit by hanges to spe i� path. . .$ git log -- some/file
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Faster grepanother way to sear h. . .$ git grep -e "pattern" -- some/file$ git grep -e "pattern" bran h -- some/file
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Faster grepanother way to sear h. . .$ git grep -e "pattern" -- some/file$ git grep -e "pattern" bran h -- some/file
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen esthings that point to ommitslightweightmutabledisposable3 basi types
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen esthings that point to ommitslightweightmutabledisposable3 basi types
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen esthings that point to ommitslightweightmutabledisposable3 basi types
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen esthings that point to ommitslightweightmutabledisposable3 basi types
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen esthings that point to ommitslightweightmutabledisposable3 basi types
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen eslo al bran hes
◮ $ git bran h -lbran h1bran h2* master◮ .git/refs/heads/<bran h>
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen estags
◮ $ git tag -ltag1tag2tag3◮ .git/refs/tags/<tag>
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Referen esremote bran hes
◮ $ git bran h -rfred/masterjoe/masterjoe/another-bran h◮ .git/refs/remotes/<remote>/<bran h>
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Creating bran hes$ git bran h name ommit
◮ new bran h �name� on HEAD or spe i�ed ommit
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Swit hing bran hes$ git he kout -f name
◮ he kout �les from �name� bran h◮ optionally for e overwriting hanged �les
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Create and swit h$ git he kout -b name ommit
◮ he kout �les from �name� bran h
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Swit hing with hanges$ git he kout nameerror: You have lo al hanges to 'filename'; annot swit h bran hes.$ git he kout -m name
◮ merge outstanding di� onto bran h �name�◮ an result in on�i t
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Swit hing with hanges$ git he kout nameerror: You have lo al hanges to 'filename'; annot swit h bran hes.$ git he kout -m name
◮ merge outstanding di� onto bran h �name�◮ an result in on�i t
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesstart at some treemasterA
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git he kout -b bug-fixmaster
HEAD
bug−fi A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git ommit -a -m�B�master
HEAD
Bbug−fi
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git ommit -a -m�C�master
HEAD
C
B
bug−fi
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesyou have a wi ked ideamaster
HEAD
C
B
bug−fi
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesyou have a wi ked idea$ git he kout -b wi ked mastermaster
HEADC
B
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git ommit -a -m�D�master
HEAD
C
B
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git ommit -a -m�E�master
HEAD
C
B
E
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesyou're getting somewheremaster
HEAD
C
B
E
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesyou're getting somewhere$ git tag -a -m``got somewhere'' goodmaster
HEAD
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesmanager asks about the bugmaster
HEAD
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesmanager asks about the bug$ git he kout bug-fixmaster
HEAD
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git ommit -a -m�F�master
HEAD
F
C
B
goodE
D
bug−fi wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesyour mind is elsewhere. . .master
HEAD
F
C
B
goodE
D
bug−fi wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesyour mind is elsewhere. . .$ git he kout wi kedHEAD
F
C
B
goodE
D
bug−fi wicked
A master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes. . . so you �nish o� the wi kedfeature$ git ommit -a -m�G�HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesfeature's donebug is �xed. . . time to merge HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesfeature's donebug is �xed. . . time to merge HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hesfeature's donebug is �xed. . . time to merge HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git he kout mastermaster
HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git he kout master$ git merge bug-fixor$ git he kout master$ git reset --hard bug-fix master
HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git he kout master$ git merge bug-fixor$ git he kout master$ git reset --hard bug-fix master
HEAD
F
G
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git merge wi ked. . . in ase of on�i t run$ git mergetool master
HEAD
H
F
G
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working on bran hes$ git merge wi ked. . . in ase of on�i t run$ git mergetool master
HEAD
H
F
G
C
B
goodE
D
bug−fi
wicked
A
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging$ git merge <bran h> ...
◮ merge multiple bran hes◮ reates ommit with 2+ parents◮ an ause on�i tsie: require user intervention
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Mergingone more exampleA
one
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Mergingtwo topi bran hesA
B C
one two
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging$ git he kout -b three twoA
B C
one twothree
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging$ git he kout -b three two$ git merge oneA
B C
one two
three
D
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging
A
B C
D
E F
Gone two
three
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging$ git he kout threeA
B C
D
E F
Gone two
three
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging$ git he kout three$ git merge one twoA
B C
D
E F
Gone two
three
H
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Merging$ git he kout three$ git merge one two�o topus�
A
B C
D
E F
Gone two
three
H
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Rebasing$ git rebase <bran h>
◮ moves new work onto a new baseline◮ an ause on�i tsie: require user intervention
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
Atake two identi al trees
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
$ git merge master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
that's easy
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’ e
d
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’ e
d
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’ e
d
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’ e
d
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’ e
d
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
E
D
master
test
A
F
E’
D’
$ git rebase master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
RebasingC
B
E
D
master
test
A
merge rebase
C
B
master
test
A
F
E’
D’
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Cloning$ git lone <remote>
◮ repli ates remote repository◮ populates new repository◮ he ksout new working tree
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git URLs◮ lo al repo/home/git/proje t.git/file:///home/git/proje t.git/◮ http proto olhttp://repo.or. z/r/git.git◮ native git proto olgit://repo.or. z/git.git◮ ssh proto olssh://bart�jukie.net/~git/proje t.git/bart�jukie.net/~git/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git URLs◮ lo al repo/home/git/proje t.git/file:///home/git/proje t.git/◮ http proto olhttp://repo.or. z/r/git.git◮ native git proto olgit://repo.or. z/git.git◮ ssh proto olssh://bart�jukie.net/~git/proje t.git/bart�jukie.net/~git/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git URLs◮ lo al repo/home/git/proje t.git/file:///home/git/proje t.git/◮ http proto olhttp://repo.or. z/r/git.git◮ native git proto olgit://repo.or. z/git.git◮ ssh proto olssh://bart�jukie.net/~git/proje t.git/bart�jukie.net/~git/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git URLs◮ lo al repo/home/git/proje t.git/file:///home/git/proje t.git/◮ http proto olhttp://repo.or. z/r/git.git◮ native git proto olgit://repo.or. z/git.git◮ ssh proto olssh://bart�jukie.net/~git/proje t.git/bart�jukie.net/~git/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz
git://repo.or. z/proje t.git
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz
$ git lone ssh+git://repo.or. z/proje t.git
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz local
$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz local
$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz local
$ git lone ssh+git://repo.or. z/proje t.git build-treeInitialize build-tree/.gitInitialized empty Git repository in /tmp/build-tree/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz local
$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz local
A v0.1.0
B
C v0.2.0
F
origin/master
$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
repo.or.cz local
A v0.1.0
B
C v0.2.0
F
origin/master
$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo$ git lone ssh+git://repo.or. z/proje t.gitInitialize proje t/.gitInitialized empty Git repository in /tmp/proje t/.git/remote: Counting obje ts: 77575, done.remote: Compressing obje ts: 100% (26407/26407), done.remote: Total 77575 (delta 55750), reused 71007 (delta 49775)Re eiving obje ts: 100% (77575/77575), 22.87 MiB | 798 KiB/s, done.Resolving deltas: 100% (55750/55750), done.Che king out files: 100% (1396/1396), done.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo$ git bran h -a* masterorigin/master $ git tag -lv0.1.0v0.2.0
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo$ git bran h -a* masterorigin/master $ git tag -lv0.1.0v0.2.0
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
$ git fet h
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
$ git fet hremote: Counting obje ts: 236, done.remote: Compressing obje ts: 100% (190/190), done.remote: Total 190 (delta 170), reused 0 (delta 0)Re eiving obje ts: 100% (190/190), 69.53 KiB, done.Resolving deltas: 100% (170/170), ompleted with 40 lo al obje ts.From mail.jukie.net:work/o lug/intro-to-git573ff80..06e3703 master -> origin/master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
$ git fet hremote: Counting obje ts: 236, done.remote: Compressing obje ts: 100% (190/190), done.remote: Total 190 (delta 170), reused 0 (delta 0)Re eiving obje ts: 100% (190/190), 69.53 KiB, done.Resolving deltas: 100% (170/170), ompleted with 40 lo al obje ts.From mail.jukie.net:work/o lug/intro-to-git573ff80..06e3703 master -> origin/master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
G
H
$ git fet hremote: Counting obje ts: 236, done.remote: Compressing obje ts: 100% (190/190), done.remote: Total 190 (delta 170), reused 0 (delta 0)Re eiving obje ts: 100% (190/190), 69.53 KiB, done.Resolving deltas: 100% (170/170), ompleted with 40 lo al obje ts.From mail.jukie.net:work/o lug/intro-to-git573ff80..06e3703 master -> origin/master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
G
H
. . . no disk hanges?
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ ‘−− foo
G
H
G
H
git fet h only updates DAG
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
git merge origin/masterfast-forwards master to mat h origin/masterand updates the working tree
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
git merge origin/masterfast-forwards master to mat h origin/masterand updates the working tree
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
git merge origin/masterfast-forwards master to mat h origin/masterand updates the working tree
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
git fet h + git merge=git pull
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
git fet h + git merge=git pull
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
let's make some lo al ommits
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
$ git ommit -a -m``I''
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
I
$ git ommit -a -m``I''Created ommit b618aed: I2 files hanged, 11 insertions(+), 20 deletions(-)
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
I
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
I
$ git push
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
II
$ git pushCounting obje ts: 9, done.Compressing obje ts: 100% (5/5), done.Writing obje ts: 100% (5/5), 810 bytes, done.Total 5 (delta 4), reused 0 (delta 0)refs/heads/master: 9dd 135 -> 15b67 0To ssh+git://repo.or. z/proje t.git9dd 135..15b67 0 master -> master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
II
$ git pushCounting obje ts: 9, done.Compressing obje ts: 100% (5/5), done.Writing obje ts: 100% (5/5), 810 bytes, done.Total 5 (delta 4), reused 0 (delta 0)refs/heads/master: 9dd 135 -> 15b67 0To ssh+git://repo.or. z/proje t.git9dd 135..15b67 0 master -> master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin" local
A v0.1.0
B
C v0.2.0
F
origin/master
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
G
H
II
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
foo.com
. . . meanwhile, elsewhere on the internet . . .
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
foo.com
Fred lones the proje t.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
Fred lones the proje t.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
J
. . . and makes some hanges.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
J
Fred annot push.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
J
From: fred�foo. omSubje t: I fixed a bugPlease pull fromhttp://foo. om/proje t.git/-Fred
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
J
local
A v0.1.0
B
C v0.2.0
F
ori
gin
/maste
r
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
I
K
From: fred�foo. omSubje t: I fixed a bugPlease pull fromhttp://foo. om/proje t.git/-Fred
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
J
local
A v0.1.0
B
C v0.2.0
F
ori
gin
/maste
r
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
I
K
$ git remote add fred http://foo. om/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
foo.com
G
H
I
J
local
A v0.1.0
B
C v0.2.0
F
ori
gin
/maste
r
master
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
H
I
K
$ git remote add fred http://foo. om/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
A v0.1.0
B
C v0.2.0
F
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
Hori
gin
/maste
r
master
I
K
$ git remote add fred http://foo. om/proje t.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
A v0.1.0
B
C v0.2.0
F
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
G
Hori
gin
/maste
r
master
I
K
$ git fet h fred
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K
$ git fet h fred
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred
/maste
r
$ git fet h fred
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred
/maste
r
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
$ git log fred/master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
$ git log fred/master$ git log fred/master ^master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
$ git log fred/master$ git log fred/master ^master$ git log -p fred/master ^master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
$ git he kout -b fred-fix fred/master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
fred−fi
$ git he kout -b fred-fix fred/master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
fred−fi
$ git he kout master
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
fred−fiL
$ git he kout master$ git merge fred-fix
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
L
$ git he kout master$ git merge fred-fix$ git bran h -d fred-fix
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
L
$ git push
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
Hori
gin
/maste
r
master
I
K J
fred/m
aste
r
L
K J
L
$ git push
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
H
ori
gin
/maste
r master
I
K J
fred/m
aste
r
L
K J
L
$ git push
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Working with remotesA v0.1.0
B
C v0.2.0
F
master
"origin"
G
H
I
A v0.1.0
B
C v0.2.0
F
master
"fred"
G
H
I
J
local
/tmp/project/|−− .git/|−− bar‘−− sub/ |−− fi ‘−− foo
A v0.1.0
B
C v0.2.0
FG
H
ori
gin
/maste
r master
I
K J
fred/m
aste
r
L
K J
L
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
GUI tools◮ gitksexy view of your revision tree◮ git guiperform trivial tasks from a GUIex: add/rm �les, make ommits, bran h, et
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
GUI tools◮ gitksexy view of your revision tree◮ git guiperform trivial tasks from a GUIex: add/rm �les, make ommits, bran h, et
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
gitkhow sexy?
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
gitk
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
git-gui
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-Remember loose obje ts ?
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Loose obje ts.git/obje ts|-- 23| `-- d4bd826aba9e29aaa e9411 175b784ed 399|-- 76| `-- 49f82d40a98b1ba59057798e47aab2a99a11d3|-- 4| `-- aaefaa8a48ad4ad379d 1002b78f1a3e4 eab |-- e7| `-- 4be61128eef713459 a4e32398d689fe80864e|-- info| `-- pa ks`-- pa k|-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .idx`-- pa k-b7b026b1a0b0f193db9dea0b0d7367d25d3a68 .pa k
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Loose obje ts$ git g Counting obje ts: 636, done.Compressing obje ts: 100% (635/635), done.Writing obje ts: 100% (636/636), done.Total 636 (delta 486), reused 0 (delta 0)Removing dupli ate obje ts: 100% (256/256), done.◮ GC happens automati allywhen you get to 6700 obje ts( on�gurable)
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Loose obje ts$ git g Counting obje ts: 636, done.Compressing obje ts: 100% (635/635), done.Writing obje ts: 100% (636/636), done.Total 636 (delta 486), reused 0 (delta 0)Removing dupli ate obje ts: 100% (256/256), done.◮ GC happens automati allywhen you get to 6700 obje ts( on�gurable)
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-Stash
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stashing◮ you're ha king◮ got debug ode you don't want to ommit◮ need to work on something else
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stashing◮ you're ha king◮ got debug ode you don't want to ommit◮ need to work on something else
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stashing◮ you're ha king◮ got debug ode you don't want to ommit◮ need to work on something else
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stashing◮ git stash �des ription�◮ do that other thing◮ git stash apply
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stashing◮ git stash �des ription�◮ do that other thing◮ git stash apply
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Stashing◮ git stash �des ription�◮ do that other thing◮ git stash apply
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinggit-s m.orggit.or. z/gitwikigitready. omGitCasts. om(S ott Cha on)GitHub. om
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinggit-s m.orggit.or. z/gitwikigitready. omGitCasts. om(S ott Cha on)GitHub. om
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinggit-s m.orggit.or. z/gitwikigitready. omGitCasts. om(S ott Cha on)GitHub. om
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinggit-s m.orggit.or. z/gitwikigitready. omGitCasts. om(S ott Cha on)GitHub. om
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinggit-s m.orggit.or. z/gitwikigitready. omGitCasts. om(S ott Cha on)GitHub. om
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinghttp://www.jukie.net/~bart/blog/git://git.jukie.net/intro-to-git.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-
Further readinghttp://www.jukie.net/~bart/blog/git://git.jukie.net/intro-to-git.git/
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-Thank you.
Git the basi sBartTrojanowski,bart�jukie.netCon eptsSCM omponentsSCM operationsDe entralizationGIT HistoryRepositoryStru tureObje tsUsing GITCommandsCommitInspe tionBran hingMergingRebasingRemotesGUI toolsLoose ends-Q & A