CMPSC 311: Introduction to Systems Programming Page 1
Institute for Networking and Security Research Department of Computer Science and Engineering Pennsylvania State University, University Park, PA
Systems and Internet Infrastructure Security
i i
Version Control Systems (Part 1) Devin J. Pohly - - PowerPoint PPT Presentation
Systems and Internet i Infrastructure Security i Institute for Networking and Security Research Department of Computer Science and Engineering Pennsylvania State University, University Park, PA Version Control Systems (Part 1) Devin J.
CMPSC 311: Introduction to Systems Programming Page 1
Institute for Networking and Security Research Department of Computer Science and Engineering Pennsylvania State University, University Park, PA
i i
Page 2 CMPSC 311: Introduction to Systems Programming
Page 3 CMPSC 311: Introduction to Systems Programming
Page 4 CMPSC 311: Introduction to Systems Programming
management
Page 5 CMPSC 311: Introduction to Systems Programming
Page 6 CMPSC 311: Introduction to Systems Programming
releases like “v4.0”
Page 7 CMPSC 311: Introduction to Systems Programming
Page 8 CMPSC 311: Introduction to Systems Programming
Page 9 CMPSC 311: Introduction to Systems Programming
Repository main.c
1.1–1.50
foo.c
1.1–1.12
foo.h
1.1–1.5
Alice Bob
Page 10 CMPSC 311: Introduction to Systems Programming
Repository main.c
1.1–1.50
foo.c
1.1–1.12
foo.h
1.1–1.5
Alice Bob foo.h
1.5
foo.h
1.5
rcs co foo.h rcs co foo.h
Page 11 CMPSC 311: Introduction to Systems Programming
Repository main.c
1.1–1.50
foo.c
1.1–1.12
foo.h
1.1–1.5
Alice Bob foo.c
1.12
foo.h
1.5
foo.h
1.5
rcs co -l foo.c
Page 12 CMPSC 311: Introduction to Systems Programming
Repository main.c
1.1–1.50
foo.c
1.1–1.12
foo.h
1.1–1.5
Alice Bob foo.c
1.12
foo.h
1.5
foo.h
1.5
rcs co -l foo.c vim foo.c
Page 13 CMPSC 311: Introduction to Systems Programming
then unlocks the file so others can lock it.
Repository main.c
1.1–1.50
foo.c
1.1–1.12
foo.h
1.1–1.5
Alice Bob foo.c
1.12
foo.h
1.5
foo.h
1.5
rcs ci foo.c vim foo.h rcs ci foo.h
Page 14 CMPSC 311: Introduction to Systems Programming
Repository main.c
1.1–1.50
foo.c
1.1–1.13
foo.h
1.1–1.5
Alice Bob foo.h
1.5
foo.h
1.5
Page 15 CMPSC 311: Introduction to Systems Programming
Page 16 CMPSC 311: Introduction to Systems Programming
Repository
1–56 foo.c foo.h main.c
Alice Bob
Page 17 CMPSC 311: Introduction to Systems Programming
Repository
1–56 foo.c foo.h main.c
Alice Bob
Page 18 CMPSC 311: Introduction to Systems Programming
revision (which now contains all the files) from the repository.
Alice Bob foo.c foo.c foo.h main.c foo.h main.c
svn checkout URL svn checkout URL
Repository
1–56 foo.c foo.h main.c
Page 19 CMPSC 311: Introduction to Systems Programming
Alice Bob foo.c foo.c foo.h main.c foo.h main.c
vim foo.c vim foo.h svn commit
Repository
1–56 foo.c foo.h main.c
Page 20 CMPSC 311: Introduction to Systems Programming
Alice Bob foo.c foo.c foo.h main.c foo.h main.c Repository
1–57 foo.c foo.h main.c
Page 21 CMPSC 311: Introduction to Systems Programming
can merge them automatically.
Alice Bob foo.c foo.c foo.h main.c foo.h main.c
vim main.c svn commit
Repository
1–57 foo.c foo.h main.c
Page 22 CMPSC 311: Introduction to Systems Programming
Alice Bob foo.c foo.c foo.h main.c foo.h main.c
vim foo.c svn commit
Repository
1–57 foo.c foo.h main.c
Page 23 CMPSC 311: Introduction to Systems Programming
Alice Bob foo.c foo.c foo.h main.c foo.h main.c
svn update vim foo.c svn commit
Repository
1–57 foo.c foo.h main.c
Page 24 CMPSC 311: Introduction to Systems Programming
Alice Bob foo.c foo.c foo.h main.c foo.h main.c Repository
1–58 foo.c foo.h main.c
Page 25 CMPSC 311: Introduction to Systems Programming
56 57 58 SVN repository
Page 26 CMPSC 311: Introduction to Systems Programming
coding” sites
Page 27 CMPSC 311: Introduction to Systems Programming
to a remote repository...
from a remote repository into the local one.
Page 28 CMPSC 311: Introduction to Systems Programming
“Official” repository ..A
foo.c foo.h main.c
Alice Bob
Page 29 CMPSC 311: Introduction to Systems Programming
“Official” repository ..A
foo.c foo.h main.c
Alice Bob
Page 30 CMPSC 311: Introduction to Systems Programming
git clone URL git clone URL
“Official” repository ..A
foo.c foo.h main.c
Alice’s repository ..A
foo.c foo.h main.c
Bob’s repository ..A
foo.c foo.h main.c
Alice Bob
Page 31 CMPSC 311: Introduction to Systems Programming
Alice
A
foo.c foo.h main.c
git checkout
Alice’s repository ..A
foo.c foo.h main.c
Page 32 CMPSC 311: Introduction to Systems Programming
Alice
A
foo.c foo.h main.c
vim foo.c git add foo.c git commit
Alice’s repository ..A
foo.c foo.h main.c
Page 33 CMPSC 311: Introduction to Systems Programming
Alice
B
foo.c foo.h main.c Alice’s repository ..B
foo.c foo.h main.c
Page 34 CMPSC 311: Introduction to Systems Programming
revision A.
A B Alice’s repository
Page 35 CMPSC 311: Introduction to Systems Programming
revision A.
A B C Alice’s repository
Page 36 CMPSC 311: Introduction to Systems Programming
“official” one.
git push
A..C
“Official” repository ..A
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..B'
foo.c foo.h main.c
Alice Bob
Page 37 CMPSC 311: Introduction to Systems Programming
“Official” repository ..C
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..B'
foo.c foo.h main.c
Alice Bob
Page 38 CMPSC 311: Introduction to Systems Programming
A B’ Bob’s repository
Page 39 CMPSC 311: Introduction to Systems Programming
git push
“Official” repository ..C
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..B'
foo.c foo.h main.c
Alice Bob
Page 40 CMPSC 311: Introduction to Systems Programming
git pull
“Official” repository ..C
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..B'
foo.c foo.h main.c
Alice Bob
A..C
Page 41 CMPSC 311: Introduction to Systems Programming
A B B' C Bob’s repository
Page 42 CMPSC 311: Introduction to Systems Programming
A B B' C D Bob’s repository
Page 43 CMPSC 311: Introduction to Systems Programming
git push
“Official” repository ..C
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..D
foo.c foo.h main.c
Alice Bob
Page 44 CMPSC 311: Introduction to Systems Programming
“Official” repository ..D
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..D
foo.c foo.h main.c
Alice Bob
Page 45 CMPSC 311: Introduction to Systems Programming
rather than from the “official” repository.
git pull BOB_URL
“Official” repository ..D
foo.c foo.h main.c
Alice’s repository ..C
foo.c foo.h main.c
Bob’s repository ..D
foo.c foo.h main.c
Alice Bob
C..D
Page 46 CMPSC 311: Introduction to Systems Programming
“Official” repository ..D
foo.c foo.h main.c
Alice’s repository ..D
foo.c foo.h main.c
Bob’s repository ..D
foo.c foo.h main.c
Alice Bob
Page 47 CMPSC 311: Introduction to Systems Programming