This document provides an introduction to using Subversion for document version control. It discusses the advantages of version control like backup/restore, synchronization, and tracking changes. It defines common version control terms and concepts. It then demonstrates how to perform basic Subversion actions like checking out a file, adding a new file, updating files, committing changes, and viewing diffs between revisions. It also covers more advanced topics like branching and merging through examples.
8. Basic Setup
Repository (repo)
“The database stroring the files”
Server
“The computer storing the repository”
Client
“The computer connecting to the repo”
9. Basic Setup
Working Set / Working Copy
“Your local directory of files, where you make
change”
Trunk / Main
“The “Primary” location for code in the repo.”
10. Basic Setup
Baseline
“An Approved revision (or version number) of
a document or source file from which
subsequent changes can be made”
11. Basic Actions
Add
“Put a file into the repo ‘for the first time’ ”
Revision
“What version a file is on”
Head
“The latest revision in repo”
12. Basic Actions
Check out
“Download a file from the repo”
Check in / Commit
“Upload a file into the repo.The file gets a
new revision number”
Checkin Message
“A short message to describe what was
changed”
13. Basic Actions
Changelog / History
“A list of change made to a file since it was
created.”
Update / Sync
“Synchronize your file with the latest from the
repository”
15. Advanced Actions
Branch
“Create a separate copy of a file/folder for
private use (bug fixing, testing, etc.)”
Diff / Change / Delta
“Finding the differences between two files”
Merge (or patch)
“Apply the changes from one file (or branch)
to another file or trunk”
16. Advanced Actions
Conflict
“When pending changes to a file contradict
each other (both cannot be applied)”
Resolve
“Fixing the changes that contradict each
other and checking the correct version”
17. Advanced Actions
Locking
“ ‘Taking Control’ of a file so nobody else can
edit until you unlock it.”
Breaking the lock
“Forcibly unlocking file that was locked”
19. Version Control System
• Git - Linux Kernel, X.org
• Subversion - Apache Software Foundation,
PHP, Google Code
• Mercurial - Mozilla projects, NetBeans,
OpenJDK
23. File Sharing
X
Repository
X X
Pat Daniel
Pat & Daniel read code from repository
24. File Sharing
X
Repository
X' X''
Pat Daniel
Pat & Daniel make change with there file
25. File Sharing
X'
Repository
X' X''
Pat Daniel
Pat write his file to repository.
So, current version in the repository come from Pat
26. File Sharing
X''
Repository
X' X''
Pat Daniel
Daniel do the same like Pat.
But everything from Pat is overwrite by Daniel file
27. Lock-Modify-Unlock
X
Read Could not Read
Repository
Lock
X X
Pat Daniel
Pat start with read file from repository and lock it
28. Lock-Modify-Unlock
X'
Write Read
Repository
Unlock
X' X'
Pat Daniel
Pat write his changes to repository and unlock it
29. Copy-Modify-Merge
X
Read Read
Repository
X X
Pat Daniel
Pat and Daniel boat copy file from repository
to his private directory (Working Copy)
30. Copy-Modify-Merge
X
Repository
X' X''
Pat Daniel
Pat and Daniel make changes in there working copy
31. Copy-Modify-Merge
X''
Write
Repository
X' X''
Pat Daniel
Daniel write his file to repository
32. Copy-Modify-Merge
X''
Could not write
Repository
X' X''
Pat Daniel
Pat could not write file to repository
because his version is out-of-date
33. Copy-Modify-Merge
Read
X''
Repository
X' X'' X''
Pat Daniel
Solution: Pat read file from repository
34. Copy-Modify-Merge
Write
X*
Repository
X* X''
Pat Daniel
Solution: Pat merge his file in working copy and new version from Repository then
write it to repository
52. Lab III: Update
Objective
• To understand how to ‘update’ file in SVN
• To solve problem when ‘conflict’ found
Note
• This is the best practice before you commit
file to repository for avoid conflict