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 2) 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 2) 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
first argument is the command
config command to set up a name and email.”
git config --global user.name "Your Name" git config --global user.email "foo4242@psu.edu"
Page 4 CMPSC 311: Introduction to Systems Programming
repository.
by checking out the head revision.
git clone https://github.com/djpohly/text.git git clone text bob
Page 5 CMPSC 311: Introduction to Systems Programming
Page 6 CMPSC 311: Introduction to Systems Programming
and it’s one way of sharing your changes with someone else, especially if they don’t have a Git repository.
Page 7 CMPSC 311: Introduction to Systems Programming
Page 8 CMPSC 311: Introduction to Systems Programming
give the -p (patch) flag
Page 9 CMPSC 311: Introduction to Systems Programming
then any further description needed.
Page 10 CMPSC 311: Introduction to Systems Programming
like a combined log/diff.
Page 11 CMPSC 311: Introduction to Systems Programming
that will be the same for everyone.
Page 12 CMPSC 311: Introduction to Systems Programming
D Repository master
Page 13 CMPSC 311: Introduction to Systems Programming
branch we are currently on.
D Repository master newidea git branch newidea
Page 14 CMPSC 311: Introduction to Systems Programming
D E Repository master newidea git commit
Page 15 CMPSC 311: Introduction to Systems Programming
D E F Repository master git commit newidea
Page 16 CMPSC 311: Introduction to Systems Programming
D E F Repository git checkout newidea newidea master
Page 17 CMPSC 311: Introduction to Systems Programming
D E G F Repository master newidea git commit
Page 18 CMPSC 311: Introduction to Systems Programming
D E G F Repository master newidea H git commit
Page 19 CMPSC 311: Introduction to Systems Programming
Page 20 CMPSC 311: Introduction to Systems Programming
git checkout -b newidea vim hello git add hello git commit git checkout master git checkout newidea
Page 21 CMPSC 311: Introduction to Systems Programming
Page 22 CMPSC 311: Introduction to Systems Programming
reference forward along the commit graph.
Page 23 CMPSC 311: Introduction to Systems Programming
avoid this, use fetch instead.
repository.
Page 24 CMPSC 311: Introduction to Systems Programming
commits from newidea.
Page 25 CMPSC 311: Introduction to Systems Programming
merged the branches.
Page 26 CMPSC 311: Introduction to Systems Programming
use the blame command.
Page 27 CMPSC 311: Introduction to Systems Programming
Page 28 CMPSC 311: Introduction to Systems Programming
existing repository
in a directory, use the init command.
directory:
Git to track.
Page 29 CMPSC 311: Introduction to Systems Programming
collaborative tool, but it doesn’t replace actual teamwork!
Page 30 CMPSC 311: Introduction to Systems Programming
◾ Try Git: try.github.io ◾ Learn Git Branching: pcottle.github.io/learnGitBranching ◾ Git Immersion (with Ruby scripts): gitimmersion.com
◾ Git for Ages 4 and Up: youtu.be/1ffBJ4sVUb4
◾ Git Magic:
www-cs-students.stanford.edu/~blynn/gitmagic
◾ Pro Git: git-scm.com/book ◾ Version Control by Example: ericsink.com/vcbe
Page 31 CMPSC 311: Introduction to Systems Programming
make the switch
Page 32 CMPSC 311: Introduction to Systems Programming
Page 33 CMPSC 311: Introduction to Systems Programming
Page 34 CMPSC 311: Introduction to Systems Programming
Page 35 CMPSC 311: Introduction to Systems Programming
Page 36 CMPSC 311: Introduction to Systems Programming
Page 37 CMPSC 311: Introduction to Systems Programming
Page 38 CMPSC 311: Introduction to Systems Programming
Page 39 CMPSC 311: Introduction to Systems Programming
Page 40 CMPSC 311: Introduction to Systems Programming