+ All Categories
Home > Documents > Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf ·...

Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf ·...

Date post: 21-Jun-2019
Category:
Upload: vanthu
View: 229 times
Download: 0 times
Share this document with a friend
31
Transcript
Page 1: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Version Control

CS 370 SE Practicum, Cengiz Günay

(Some slides courtesy of Eugene Agichtein and the Internets)

CS 370, Günay (Emory) Version Control Spring 2014 1 / 15

Page 2: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Agenda

Make-up lecture:

Diagrams useful for your project designsWatch it and do survey by Thursday 3/27

Project milestone:

4/10 functional prototype opens for testing

Other news:

May collect some experienced entrepreneurs/venture capitalists to seeyour projects at the end of semester

Today: Version control

Centralized: Subversion

Distributed: GIT

CS 370, Günay (Emory) Version Control Spring 2014 2 / 15

Page 3: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Agenda

Make-up lecture:

Diagrams useful for your project designsWatch it and do survey by Thursday 3/27

Project milestone:

4/10 functional prototype opens for testing

Other news:

May collect some experienced entrepreneurs/venture capitalists to seeyour projects at the end of semester

Today: Version control

Centralized: Subversion

Distributed: GIT

CS 370, Günay (Emory) Version Control Spring 2014 2 / 15

Page 4: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Agenda

Make-up lecture:

Diagrams useful for your project designsWatch it and do survey by Thursday 3/27

Project milestone:

4/10 functional prototype opens for testing

Other news:

May collect some experienced entrepreneurs/venture capitalists to seeyour projects at the end of semester

Today: Version control

Centralized: Subversion

Distributed: GIT

CS 370, Günay (Emory) Version Control Spring 2014 2 / 15

Page 5: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Agenda

Make-up lecture:

Diagrams useful for your project designsWatch it and do survey by Thursday 3/27

Project milestone:

4/10 functional prototype opens for testing

Other news:

May collect some experienced entrepreneurs/venture capitalists to seeyour projects at the end of semester

Today: Version control

Centralized: Subversion

Distributed: GIT

CS 370, Günay (Emory) Version Control Spring 2014 2 / 15

Page 6: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Why Version Control?

It's a must in today's computing industry

I Mt. Gox, a company that don't use VC and lost almost a billiondollars. . .

I Other painful stories without VC

You can even version control documents, class �les, �nancial �les, . . .

Also called source control, code management, concurrent versioning,revision control, . . .

Advantages:

I Track changes, keep logs of past developmentI Automatic backups/safety netI Concurrent versions: XP vs. Win8I Allows teamwork

CS 370, Günay (Emory) Version Control Spring 2014 3 / 15

Page 7: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Why Version Control?

It's a must in today's computing industry

I Mt. Gox, a company that don't use VC and lost almost a billiondollars. . .

I Other painful stories without VC

You can even version control documents, class �les, �nancial �les, . . .

Also called source control, code management, concurrent versioning,revision control, . . .

Advantages:

I Track changes, keep logs of past developmentI Automatic backups/safety netI Concurrent versions: XP vs. Win8I Allows teamwork

CS 370, Günay (Emory) Version Control Spring 2014 3 / 15

Page 8: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Teamwork on the same codebase: How?Seriously, how?

CS 370, Günay (Emory) Version Control Spring 2014 4 / 15

Page 9: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Teamwork on the same codebase: How?Seriously, how? No control? Overwrite chaos!

CS 370, Günay (Emory) Version Control Spring 2014 4 / 15

Page 10: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Teamwork on the same codebase: How?Seriously, how? Locking

CS 370, Günay (Emory) Version Control Spring 2014 4 / 15

Page 11: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Teamwork on the same codebase: How?Seriously, how? Merging

CS 370, Günay (Emory) Version Control Spring 2014 4 / 15

Page 13: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Each commit/check-in increments version

Page 14: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

What is Subversion?

• A centralized version control system

• Not the newest form of configuration management, but easy to use and popular– Founded in 2000– Successor to widely used CVS

• Aka SVNSlide 6

Repository

Page 15: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Centralized version control: Subversion (SVN)

Documentation

http://svnbook.red-bean.com/

Common SVN usage scenario:

1 svn checkout gets working copy from repo

2 Make local changes in working copy

3 svn update gets latest changes from repo to sync

4 svn commit (or checkin) sends your changes to repo

Page 16: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Investigating the past

svn diff shows your changes from last repoversion

svn diff -cX shows changes in version X

svn log [filename] shows all commit logs

Example: How to �nd a bug

1 You have been messing with the code

2 Suddenly you realized you broke the program

3 How do you �nd when was the bug introduced?

4 Hint: Can go back with svn update -rX

Page 17: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Investigating the past

svn diff shows your changes from last repoversion

svn diff -cX shows changes in version X

svn log [filename] shows all commit logs

Example: How to �nd a bug

1 You have been messing with the code

2 Suddenly you realized you broke the program

3 How do you �nd when was the bug introduced?

4 Hint: Can go back with svn update -rX

Page 18: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Investigating the past

svn diff shows your changes from last repoversion

svn diff -cX shows changes in version X

svn log [filename] shows all commit logs

Example: How to �nd a bug

1 You have been messing with the code

2 Suddenly you realized you broke the program

3 How do you �nd when was the bug introduced?

4 Hint: Can go back with svn update -rX

Page 19: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Advanced concepts: tags, branches, and merging

svn tag <name> [-rX] marks a version(e.g., release)

svn copy clones current version as branch

svn merge reintegrates branch to main trunk

1

2

3

4

5

6

7

8

10

9

T1

T2

Trunks

Branches

Merges

Tags

Discontinueddevelopment

branch

CS 370, Günay (Emory) Version Control Spring 2014 9 / 15

Page 20: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Advanced concepts: tags, branches, and merging

svn tag <name> [-rX] marks a version(e.g., release)

svn copy clones current version as branch

svn merge reintegrates branch to main trunk

What is it good for?

Tags for beta test releases, main releases,patches

Branches for experimental development

See the SVN book for more info

1

2

3

4

5

6

7

8

10

9

T1

T2

Trunks

Branches

Merges

Tags

Discontinueddevelopment

branch

CS 370, Günay (Emory) Version Control Spring 2014 9 / 15

Page 21: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Limitations of centralized version control

Tell me!

Obvious: it's centralized! Needs network for:

1 making commits2 getting updates3 inspecting revision history (logs, di�, etc)

What if you're coding on a plane?

I Enter distributed version control

CS 370, Günay (Emory) Version Control Spring 2014 10 / 15

Page 22: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Limitations of centralized version control

Tell me!

Obvious: it's centralized! Needs network for:

1 making commits2 getting updates3 inspecting revision history (logs, di�, etc)

What if you're coding on a plane?

I Enter distributed version control

CS 370, Günay (Emory) Version Control Spring 2014 10 / 15

Page 23: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Limitations of centralized version control

Tell me!

Obvious: it's centralized! Needs network for:

1 making commits2 getting updates3 inspecting revision history (logs, di�, etc)

What if you're coding on a plane?

I Enter distributed version control

CS 370, Günay (Emory) Version Control Spring 2014 10 / 15

Page 24: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Get your own repo!

Can do all VC operations locally now!

Thus you need to clone a repo

Page 25: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Get your own repo!

Can do all VC operations locally now!

Thus you need to clone a repo

Page 26: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

So what is local and what is remote?

Local operations (same as previous):

update/commit

tag/branch

log/di�

Remote operations (new concepts):

Pull: Get all changesets fromorigin repo

Push: Send your changesets toorigin

Still has origin repo to communicate between team members

In Git, pull can be divided into fetch+merge (like SVN branch merge)

Page 27: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

So what is local and what is remote?

Local operations (same as previous):

update/commit

tag/branch

log/di�

Remote operations (new concepts):

Pull: Get all changesets fromorigin repo

Push: Send your changesets toorigin

Still has origin repo to communicate between team members

In Git, pull can be divided into fetch+merge (like SVN branch merge)

Page 28: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

So what is local and what is remote?

Local operations (same as previous):

update/commit

tag/branch

log/di�

Remote operations (new concepts):

Pull: Get all changesets fromorigin repo

Push: Send your changesets toorigin

Still has origin repo to communicate between team members

In Git, pull can be divided into fetch+merge (like SVN branch merge)

Page 29: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

We will use Github

We have educational account with private repositories

Open accounts on GitHub and send us your account ids!

Page 30: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

Example GitHub project

Git documentation: http://git-scm.com/documentation

Page 31: Version Control - Emory Universitycengiz/cs540-485-soft-eng-fa14/slides/17-version-control.pdf · Version Control CS 370 SE Practicum, Cengiz Günay (Some slides courtesy of Eugene

History of version control software

Revision Control System (RCS):

Provided ci, co (checkin, checkout) commands underUNIX.Create revisions for each �le invidually

Concurrent Version System (CVS):

Like RCS, but systemic for directoriesCollects revision �les into repos

Subversion (SVN):

Allows renaming directories easilyRevisions not in �les, but kept in database

GIT:

Because somebody called Linus Torvald a git

Developed to keep track of changes in Linux kernel

Others:

Microsoft SourceSafe, Mercurial, . . .

CS 370, Günay (Emory) Version Control Spring 2014 15 / 15


Recommended