Académique Documents
Professionnel Documents
Culture Documents
By Nathan Bertram
7th / August / 2008
Intro.
Working Copy / Working Set - Your local directory of files, where you make changes.
Client
A
Repository
Repository
Client Client
J H
Client Client Client
C A B
More Basic Terminology
Add - Put a file into the repo for the first time (begin tracking it with Version Control).
Check In / Commit - Upload a file to the repository (if it has changed). The file gets a
new revision number, and team members can “check out” the latest one.
Update / Sync - Synchronize your files with the latest from the repository. This lets you
grab the latest revisions of all files.
Revert - Throw away your local changes and reload the latest version from the repository.
Status - What files with in your working directory have been modified.
Basic Checkins
Main Trunk
ice cream
hp sauce
Rev. 1
Joe creates list.txt with two lines of text and adds it to the repository he has just set up.
Basic Checkins
Main Trunk
Jeff checks out list.txt and edits the file and removes the line “hp sauce” from the file
and adds in “bread”, “milk” and “eggs”. Jeff then checks in the list.txt.
Basic Checkins
Main Trunk
Each time we check in a new copy a new revision number is set for the file.
A Closer Look
Main Trunk
ice cream
Revert bread Check In
milk
eggs
Working Copy
Intermediate / Advanced Terminology
Diff / Change / Delta - Finding variance between two files.
Branch - Create a separate copy of a file/folder for private use (debugging, experimenting & etc).
Merge / Patch - Apply changes from one file to another, to bring it up to date.
Conflict - When pending changes to a file contradict each other (both changes cannot be applied).
Resolve - Fixing the files that contradict each other and checking in the fixed correct
Locking - “Taking Control” over a file. So that only the owner of the file can edit the file until the
owner has unlocked the file. Used to avoid conflicts in critical phase of file.
Breaking the Lock - Forcibly unlocking a file so that you can edit it. It may be needed if
someone on the team is away.
Tagging - Define your own version number in addition to the revision numbering.
Eg. v1.01, 1.02, 1.03 or v1.0, v1.5, v2.0
Basic Diffs
Main Trunk
Diff / Change / Delta - Finding variance between two files. Many VCS store Diffs
rather than entire copies of the file to save space over multiple versions.
Branching
ice cream ice cream
ice cream
soup soup
hp sauce
rice peanuts
Rev. 2 Rev. 3 Rev. 5
Branch
Main Trunk
Branching allows us to make a copy of our files in a folder and work with them
separately from the Main Trunk.
Merging
Milk
Milk Eggs
Eggs + Cake Bread
Bread Cake
Rev. 2 Rev. 3
Branch
Main Trunk
Main Trunk
ice cream
Jane: hp sauce
+ eggs
- hp sauce
ice cream
eggs
Rev. 1 Rev. 2
Conflicts arise when pending changes to a file contract each other. Both changes cannot be
applied. Joe and Jane both check out the file at the same time. Jane is the first check in her
changes. Joe goes to check in his version of the file later in the day. However, a conflict arrises
because in the latest revision in the repository there is no hp sauce to remove!
Resolving Conflicts!
ice cream
Joe: hp sauce
+ bread
- hp sauce
ice cream
bread
Rev. 1 Conflict
Main Trunk
When conflicts arise it is up to you to check in a newer version that resolves the conflict.
One approach is to sync to the current version of the file and reapply your changes to it.
Key Points.
- Easily keep track of who, when and why changes occurred.
- Your project files are always backed up on a remote server in a repository.
- Easily collaborate on the same code base at any given time.
- Jump back in time an access previous revisions.
- Branch out and develop other features while the main project goes on.
- Take it slow and keep on learning.
Resources.
Good Reads:
betterexplained.com/articles/a-visual-guide-to-version-control/
thinkvitamin.com/features/design/subversion-for-designers
athleticsnyc.com/blog/entry/on-using-subversion-for-web-projects
In-depth Explanation:
http://www.ericsink.com/scm/source_control.html
SVN Windows:
http://tortoisesvn.tigris.org/
Git:
http://www.gitcasts.com/
http://git.or.cz/course/svn.html
www.github.com
Web Apps:
http://www.beanstalkapp.com/
http://springloops.com/
http://cvsdude.com/
http://svnrepository.com/