Top Banner
Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012
21

Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Jan 01, 2016

Download

Documents

Ira Hood
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Source Control Primer

Patrick CozziUniversity of PennsylvaniaCIS 565 - Spring 2012

Page 2: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Why Source Control?

How do two people collaborate on the same code?Email?Dropbox?

Page 3: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Why Source Control?

How do two people collaborate on the same code?Email?Dropbox?

How do two hundred people collaborate?

Page 4: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Why Source Control?

How do we backup our code?

How do we get a history of changes?

Page 5: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Why Source Control?

How do we make big or risky code changes without affecting the stable version?

How do we work on new versions and still support old versions?

Page 6: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Popular Tools

Images from https://twitter.com/perforce, http://alagazam.net/, and https://twitter.com/GitHub

Page 7: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Server holds a centralized repository

Clients have a revision

Page 8: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Page 9: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Submit

Page 10: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Page 11: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Get Latest Revision

Page 12: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Modify/add/remove files

Page 13: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Submit

Page 14: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Centralized

Get Latest Revision

Page 15: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

DistributedAll machines have a full copy of the repository

Repositories can be cloned

Repositories can be pushed to and pulled from other machines

Page 16: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Distributed

Create a local repoLocally commit changes

git init// Add files to directorygit add *git commit –a –m ‘<description>’

Page 17: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Distributed

Clone a remote repo

git clone [email protected]:CIS565-Spring-2012/cis565testHomework.git

Page 18: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Distributed

Locally commit changes

git commit –a –m ‘<description>’

Page 19: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Distributed

Push changes to other repos

git push

Page 20: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Distributed

Pull changes from other repos

git pull

Page 21: Source Control Primer Patrick Cozzi University of Pennsylvania CIS 565 - Spring 2012.

Summary

We are using git this semester - distributed source control

Use source control for everything, not just code