0% found this document useful (0 votes)
46 views18 pages

Lecture8 Version Control Systems Intro

The document discusses version control systems and their usage for software development. It covers centralized and distributed version control systems like Subversion and Git/Mercurial. It describes features like cloning repositories, committing code, tracking revisions, collaborating via push and pull, and recovering from mistakes. The document recommends using version control for all projects and provides additional resources for learning more about Subversion, Mercurial and Git.

Uploaded by

d2009t228
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views18 pages

Lecture8 Version Control Systems Intro

The document discusses version control systems and their usage for software development. It covers centralized and distributed version control systems like Subversion and Git/Mercurial. It describes features like cloning repositories, committing code, tracking revisions, collaborating via push and pull, and recovering from mistakes. The document recommends using version control for all projects and provides additional resources for learning more about Subversion, Mercurial and Git.

Uploaded by

d2009t228
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Version Control

Or distributed time machines to create better software


Nikhil Marathe
[email protected]

Software Development Cycle


Design Release!
(once in a while)

Code

Test

Software Development Cycle


Scaled by People Time

denny :p

Enter Version Control Systems

Centralized

Distributed

Clones and Checkouts


get your own copy of the code

Subversion checks out


svn co https://myawesome.com/pristine/trunk myawesome

With distributed you clone


git clone https://awesome2.org/awesome2/awesome2.git hg clone https://hgbasedproject.org/bazinga/

Clones vs. Checkouts


Introduce a little anarchy...

Subversion aside
initial repository creation

$ svnadmin create\ /path/repo

+
a few more steps

/path/repo | |-branches |-awesome-1.0.2/ `-bazinga-0.5.0/ |-tags `-trunk |-awesome/ |-bazinga/

Commits
hg/svn/git commit

Git has the concept of a staging area which adds better control on the versioning, and gives more freedom while editing, but introduces a two step commit process. hg has a similar extensions called crecord

Hack hack hack

Revisions
Way to identify a snapshot of the code SVN - 1,2,3,4......1019123.... Git/Hg SHA1 hash eg. a954467190e7ab871433e8571da75e1768b6b583 Special revisions such as HEAD, tip, ORIGIN

Collaboration - push & pull


ALICE (private) ALICE (public) master

BOB
(public)

BOB
(private)

Commit

Pull

Push

Recovering from mistakes


rollbacks and reverts

diff and merge

Usual workflow
on a nice new day update/pull in changes from others see whats new, resolve any conflicts work on your feature hack hack hack keep committing atomically push to public/central repository asend a pull request if you want blog about cool new feature

That should keep you occupied for several months


Or - you don't really understand it until you do it.

Good practices
Commit frequently Commit atomically Put in good commit messages No binary/generated files in the repo Never, never, never, never, never, ever break the build

What I didn't cover


Repository administration, staging area, stash, rebase, shelve, Mercurial Queues Diff formats, Resolving merge conflicts

That's all Folks!


Use it for your current project, and every one after that Get yourself an account on bitbucket.org for Hg Or use code.google.com/hosting/ with svn or Hg No point in using Git in college since the ports are blocked SVN - subversion.tigris.org Mercurial - mercurial.selenic.com Git - git-scm.org The SVN book svnbook.red-bean.com The Hg book hgbook.red-bean.com The Git Parable http://tom.preston-werner.com/2009/05/19/the-gitparable.html

You might also like