![Page 1: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/1.jpg)
Andrei Chis
Distributed version control with git — a brief introduction
based on slides by Oscar Nierstrasz
![Page 2: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/2.jpg)
Why version control?
�2
![Page 3: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/3.jpg)
�3
Bob
Why version control?
![Page 4: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/4.jpg)
�4
Bob Carol
Why version control?
![Page 5: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/5.jpg)
�5
Bob Carol
TedAlice
Why version control?
![Page 6: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/6.jpg)
�6
Bob Carol
TedAlice
Why version control?
![Page 7: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/7.jpg)
�7
Bob Carol
TedAlice
Why version control?
![Page 8: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/8.jpg)
�8
Bob Carol
TedAlice
A recipe for disaster!
Why version control?
![Page 9: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/9.jpg)
�9
Cope with the confusion that happens when multiple people edit
the same files
Why version control?
![Page 10: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/10.jpg)
Bob
Repository
Carol
![Page 11: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/11.jpg)
Bob
Repository
Carol
![Page 12: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/12.jpg)
Bob
Repository
Snapshot Version 1
Carol
![Page 13: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/13.jpg)
Bob
Repository
Version 1
Carol
![Page 14: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/14.jpg)
Bob
Repository
Snapshot
Version 1
Version 2Carol
![Page 15: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/15.jpg)
Bob
Repository
Version 1
CarolVersion 2
![Page 16: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/16.jpg)
Bob
Repository
Version 1
CarolVersion 2
![Page 17: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/17.jpg)
Bob
Repository
Version 1
CarolVersion 2
SnapshotVersion 3
![Page 18: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/18.jpg)
Bob
Repository
Version 1
CarolVersion 2
Version 3
Version 4
Version 5
Version 6
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 100
Version 101
Version 103
AliceTed
![Page 19: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/19.jpg)
Bob
Repository
Version 1
CarolVersion 2
Version 3
Version 4
Version 5
Version 6
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 1
Version 2
Version 3
Version 100
Version 101
Version 103
AliceTed
Can still lead to disaster!
Controlled evolution
![Page 20: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/20.jpg)
git
![Page 21: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/21.jpg)
gitTracks the history of a collection of files
![Page 22: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/22.jpg)
gitTracks the history of a collection of files
Can revert the collection of files to another version
![Page 23: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/23.jpg)
git
distributed version control
system
![Page 24: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/24.jpg)
What is acentralized version
control system?
![Page 25: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/25.jpg)
Bob Carol
Central repository
![Page 26: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/26.jpg)
Bob Carol
Central repository
checkout
![Page 27: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/27.jpg)
Bob Carol
Central repository
checkoutcheckout
![Page 28: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/28.jpg)
Bob Carol
Central repository
![Page 29: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/29.jpg)
Bob Carol
Central repository
commit
![Page 30: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/30.jpg)
Bob Carol
Central repository
updatecommit
![Page 31: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/31.jpg)
Bob Carol
Central repository
commit
![Page 32: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/32.jpg)
Bob Carol
Central repository
commit
![Page 33: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/33.jpg)
Bob Carol
Central repository
commit commitconflict
X
![Page 34: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/34.jpg)
Bob Carol
Central repository
commit commitconflict
X
you must update before every commit
![Page 35: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/35.jpg)
What is adistributed version
control system?
![Page 36: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/36.jpg)
Bob Carol
Remote repository(groupXY)
![Page 37: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/37.jpg)
Bob Carol
Remote repository(groupXY)
local repository
clone
![Page 38: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/38.jpg)
Bob Carol
Remote repository(groupXY)
local repository
clone
local repository
clone
![Page 39: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/39.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repository
![Page 40: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/40.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
![Page 41: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/41.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
push
![Page 42: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/42.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
push pull
![Page 43: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/43.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
push
![Page 44: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/44.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
push
![Page 45: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/45.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
pushcommit
![Page 46: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/46.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
pushcommitpush
conflict
X
![Page 47: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/47.jpg)
Bob Carol
Remote repository(groupXY)
local repository
local repositorycommit
pushcommitpush
conflict
X
you must pull before every push
![Page 48: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/48.jpg)
groupX
![Page 49: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/49.jpg)
groupX
Remote repository
(p2exercises)
![Page 50: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/50.jpg)
groupX
Remote repository
(p2exercises)
![Page 51: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/51.jpg)
groupX
git remote add p2exercises ...
Remote repository
(p2exercises)
![Page 52: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/52.jpg)
groupX
git remote add p2exercises ...
git pull p2exercises master
Remote repository
(p2exercises)
![Page 53: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/53.jpg)
groupX
Remote repository
(p2exercises)
![Page 54: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/54.jpg)
groupX
do not commit after the deadline; it leads to merge conflicts
Remote repository
(p2exercises)
![Page 55: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/55.jpg)
Basic git
![Page 56: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/56.jpg)
commit
A “commit” is “a set of changes” to a “set of files”
![Page 57: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/57.jpg)
commitcommit
Most commits modify (or merge) earlier commits
![Page 58: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/58.jpg)
commit
branch
commit
A graph of commits may belong to a
branch
![Page 59: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/59.jpg)
commit
master
commit
master is the main branch
![Page 60: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/60.jpg)
commit
HEAD
master
commit
“HEAD “is the current branch
![Page 61: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/61.jpg)
mkdir repocd repogit init
Create a git repo
C0
HEAD
master
![Page 62: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/62.jpg)
git add …
Tell git to “stage” changes
C0
HEAD
master
![Page 63: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/63.jpg)
C1
HEAD
master
git commit …
Commit your changes
C0
![Page 64: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/64.jpg)
Collaborating
![Page 65: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/65.jpg)
Public repoLocal repo
John Jane
Local repo
master
C1
C0
![Page 66: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/66.jpg)
Public repoLocal repo
John Jane
Local repo
git clone …
git clone …
mastermastermaster
C1
C0
C1
C0
C1
C0
![Page 67: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/67.jpg)
Public repoLocal repo
John Jane
Local repo
git add …git commit …
git add …git commit …
mastermastermaster
C0
C1
C0
C1
C1
C0
C2 C3
![Page 68: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/68.jpg)
Public repoLocal repo
John Jane
Local repo
git pull
(nothing new to pull)
mastermastermaster
C0
C2 C3
C1
C0
C1
C1
C0
![Page 69: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/69.jpg)
Public repoLocal repo
John Jane
Local repo
git push
mastermastermaster
C0
C2
C1
C0
C3
C1
C0
C2
C1
![Page 70: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/70.jpg)
Public repoLocal repo
John Jane
Local repo
git pull
master
C1
C0
mastermaster
C0
C2 C2
C1
C0
C1
C3 C2
![Page 71: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/71.jpg)
Public repoLocal repo
John Jane
Local repo
git pull
NB: git pull = fetch + merge
master
C1
C0
mastermaster
C0
C2 C2
C1
C0
C1
C4
C2C3
![Page 72: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/72.jpg)
Public repoLocal repo
John Jane
Local repo
git push
C3
master
C1
C0
C2
master
C1
C0
C2
master
C0
C2
C3C1
C4C4
![Page 73: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/73.jpg)
Public repoLocal repo
John Jane
Local repo
git pull
C3
master
C1
C0
C2C3
master
C1
C0
C2C3
master
C1
C0
C2
C4 C4C4
![Page 74: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/74.jpg)
![Page 75: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/75.jpg)
to be continued
![Page 76: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/76.jpg)
Resources
http://book.git-scm.com/index.htmlhttp://git-scm.com/
https://github.com/
http://www.slideshare.net/chacon/getting-git http://oreilly.com/
![Page 77: Distributed version control with git a brief introductionscg.unibe.ch/.../20-02-21-week_01-GitIntroduction.pdf · Distributed version control with git — a brief introduction based](https://reader033.vdocuments.mx/reader033/viewer/2022053007/5f0a8ce67e708231d42c2f80/html5/thumbnails/77.jpg)
http://creativecommons.org/licenses/by-sa/3.0/
Attribution-ShareAlike 3.0You are free:
▪ to copy, distribute, display, and perform the work▪ to make derivative works▪ to make commercial use of the work
Under the following conditions:
Attribution. You must attribute the work in the manner specified by the author or licensor.
Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one.
▪ For any reuse or distribution, you must make clear to others the license terms of this work.▪ Any of these conditions can be waived if you get permission from the copyright holder.
Your fair use and other rights are in no way affected by the above.