SlideShare a Scribd company logo
1 of 48
SVN
Subversion System.
Discussion point.
O Concept of version control & SVN?
O Common Function in Tortoise SVN?
O Best Practices
O Q & A
O Any Questions ??
1. Concept of version control & svn
O What is version control ?
O Versioning model
O What is SVN ?
O How to use svn?
O Svn client and plugins.
1.1 what is version control ?
O The management of changes to information
(physical: files).
O Allow concentrating and sharing files over the
network.
O Support authority and security.
O Cooperate member’s changes.
O Manage files with version, allow recovering of
desired version.
O Allow checking the modification.
O Support CM(Configuration Management) process.
1.2. Versioning models(1/2)
O Files -sharing without control. One's data may be
accidentally overwritten by other
1.2. Versioning models(1/2)
O Lock-modify-unlock solution:
weak point is not allow many
persions to work on the same
file at the same time.
1.2. Versioning models(2/2)
O Copy-Modify-Merge solution
(SVN recommended):
Allow many persons to work
on the same file at the same
time, but must apply file
merging before submitting.
1.2. Versioning models(2/2)
How to Use Version Control
client
server
send current revision ( n )
(do some work, test)
check status any changes since revision n?
update
update your local copy with any
changes in the repo.
(resolve conflicts)
commit
(do more work, test)
save your changes and log entry
1.3 What is SVN ?
O Subversion (abbreviated SVN) is a free open-source
version control system.
O Managed folders/files are placed into a repository. A
repository is much like an ordinary file server.
O Can operate across networks,which allows it to be used
by people on different computers.
1.3 SVN Layout
1.3 SVN Layout
tags
branches
trunk
Project 1
Root
Project 2
tags
branches
trunk
tags
trunk
Project 1
Repository parent dir
Project 2
tags
trunk
One project per repository
branches
branches
URLs and Protocols
http://myhost.com:port/path/to/repository
Protocol:
svn
svn+ssh
http
https
file
Host name or
IP address
127.0.0.1
localhost
host:8443
Repository
relative
path
optional port
number
Why use svn ?
O Sufficient features
O Free / Open Source
O Support Windows, UNIX, Linux, Mac OS
O Large community: many clients/shells (TortoiseSVN,
Syncro, SmartSVN…), many plugins (VS .NET,
Eclipse, XCode IDE…)
O Plain file formats: allow to recover data when
repository broken
O Good performance (on-debate)
1.4. Svn Client and plugins
O SVN Client for Windows: SVN Plugin for Eclipse:
O (http://tortoisesvn.tigris.org) http://subclipse.tigris.org/
O
2. Common function in Tortoise SVN
O Setup TortoiseSVN, grant access right
O Browse repository
O Check out a working copy
O Add file/folder to repository
O Lock/Release repository files
O Commit to repository
O Check modification
O Update working copy
O Revision log dialog
O View differences
O Clean up
Common Function in TortoiseSVN
2.1. Setup USVN, grant access right (1/2)
2.1. Setup SVN Project repository, (1/2)
2.2 Browser Repository
O In Windows Explorer, right click > TortoiseSVN > Repo-
browser
O Put the repository URL into the dialog box
Login with given username and password
2.2 Browser Repository
O The Repo-browser opened
2.3. Add file/folder to repository
O A. Without (local) working copy folder
O In Repo-browser, right click>Add folder…
O Select source file/folder to be added
=> New files/folders will be added under current
selected folder.
2.3. Add file/folder to repository
B. With (local) working copy folder (recommended)
➢ Copy new file/folder to the working copy folder
➢In Windows Explorer, select new file/folder,right
click>TortoiseSVN>Add…
➢TortoiseSVN>Commit…=> New file/folder has a check
mark.
2.4. checkout working copy
O SVN: Checkout (head rev.) = VSS: Get latest version
O In Windows Explorer, select working folder, right click>SVN
Checkout… OR
O In Repo-browser, select the folder to check out, right
click>Checkout…
Desired revision
2.5. Lock / Release repository files(1/2)
O SVN: Checkout + Lock = VSS: Check-out
This is to avoid the conflict when another user updates the
repository while you are working on your working copy.
O How to:
In the working copy, select file to lock,
right-click>TortoiseSVN>Get lock…
=> Locked file has a lock-icon mark.
Other users will not be able to commit
until you release the locked files.
2.5. Lock / Release repository files(2/2)
O This is to release the locked files for others to commit.
How to:
O Select locked file>TortoiseSVN>Release lock
Steal the locks:
O Select locked file>TortoiseSVN>
O Get lock…
O - Check Steal the locks
This way will steal other’s lock and replace by your lock. Not recommended.
It’d be better to ask the author to release his lock
2.6. Commit to Repository
O SVN: Commit = VSS: Check-in
O This is to send the changes you made on working copy to the
repository.
How to:
O On the working copy, right click>SVN Commit…
O Before committing, you should make sure that your working copy is
up-to-date.
Should give
comments
2.7. Check Modification
O This is to know the modification status of selected file in comparison
with that file on the repository.
How to:
O On working copy, select modified file
O right click>TortoiseSVN>Check
for modifications
The Working Copy dialog shows the
status of the selected files in
comparison with that file on the
repository.
2.8. Update Working copy
O SVN: Update = VSS: Get latest version
O This is to update your working copy with new changes on the
repository.
O Periodically, you should ensure that changes done by others get
incorporated in your working copy.
How to:
O On the working copy, select folder to be updated, right click>SVN
Update…
2.9 show Revision log message
O For every change you make and commit, should provide a log
message describes the meaning of your change.
O The Log Messages dialog retrieves all those log messages and allows
you to select the desired revision.
O Revision number is applied for the
whole repository.
2.10 View Differences
O Compare working copy with a given SVN revision.
How to:
O On working copy, select file to compare
O Right click>Show log => Log messages dialog opened
O Select the revison to compare, right click>Compare with local copy
2.11 Clean up
O If a Subversion command cannot complete successfully, perhaps due
to server or network problems, your working copy can be left in an
inconsistent state.
O It is a good idea to do “clean up” at the top level of the working copy.
2.12 Status of version controlled
files/folders
O Green checkmark: normal status, under control
O Red exclamation: file has been modified since last
update and needs to be committed.
O Yellow exclamation: a conflict occurs during an update.
O Grey checkmark: this file needs to be locked
first before editing.
O Locked : file is locked. Need to unlock for
other to commit.
O Red deletion: missing file or file to be deleted
under version control.
O Blue plus: File to be added to version control.
2.13 Check for conflict
O If there are any changes on the server,
then you should "update" your working copy before
"commit"-ing your changes.
2.14 Resolve Conflicts
O "Conflict" means you have made changes to a file, and
the version in the repository has been changed, too.
O So there is a "conflict" between your work and work
already in the repository.
O Subversion client creates 4 files when a conflict exists.
2.14 Resolve Conflict
Edit-Conflict tool of TortoiseSVN
2.14 Resolve Conflict
The choices are:
(1) merge local & remote changes into one file.
(2) accept remote, discard your local changes.
(3) override remote, use your local changes.
O After resolving all conflicts, mark the file as
"resolved".
O Subversion will delete the extra 3 copies.
2.14 Resolving Conflicts in Eclipse
O Use "Compare Editor" in Synchronize perspective.
O Accept or reject changes one-by-one or all at once.
3. Best Practices
O Best practices for the correct-usage
O Avoid conflict over multi-user repository
O Enforce control and cooperation among team
3. Best Practices(1/5)
O Give comments for the commit
O Professional working style.
O Give the meaning for the update you made.
O Help to find the desired revision quickly.
O Update latest version before committing
O To assure your update is made on the latest version of the
repository.
O Right-click>SVN Update
3. Best Practices (2/5)
O Self-manage the merging, do not let TortoiseSVN to merge files
O In case there is conflict between your working copy and the
repository, you should merge file by yourself.
O Steps:
O Perform Update => TortoiseSVN creates 3 files: your original file,
the latest file from repository and the SVN merged file.
O Don’t use the merged file.
O Manually compare and merge your original file with latest file.
O Overwrite your result onto the SVN merged file.
O Commit your merged file to the repository
3 Best Practices(3/5)
f1.txt.
r70
f1.txt.
r71
f1.txt.
mine
f1.txtMergeCommit?
User 1
User 2
3. Best Practices (4/5)
O Checkout-Lock-Edit-Commit-Unlock (VSS: single
checkout)
O Apply the auto need-lock property.
O How to use?
O Before editing one file, perform Get lock => file is ready
to update, also the repository file is locked so the other
cannot commit their changes.
O Commit your file after editing
O Release lock => the other can edit and commit their
changes.
O Do not use Windows Explorer to set file attributes.
3. Best Practices (5/5)
O Use TortoiseSVN commands (right click, drag and
drop) don not use the Windows Explorer commands.
O This to keep the consistency between your working copy
to the repository. The actions have effect on both your
working copy and repository.
4. Q&A (1/3)
How to obtain a “clean” working copy (original sources only) and exclude
.svn folders.
O Select working copy>right-click>TortoiseSVN>Export
O Provide the destination folder for the “clean” working copy
How to leave (ignore) the files/folders not in source control
O Select files/folders in working copy not in source control
O Right-click>TortoiseSVN>Add to ignore list
How to add “free” files/folders (in working copy) into source control
O Select files/folders>right-click>TortoiseSVN>Add
O Commit the working copy
4. Q&A (2/3)
How to break/steal lock
O This is to break the locking on file by override the locking author.
O Check for modifications>select locked files>break lock, OR
O Right click>TortoiseSVN>Get lock, check the Steal option, OK.
O Recommend: should not use this function unless you have agreement of the
PM
Cannot login because of wrong SSL cache: clear cache
O First login to a wrong/forbidden link failed => wrong SSL is cached
O Later login (to correct link) also failed because the TortoiseSVN use the
wrong cached SSL.
O Solution: right click>TortoiseSVN>Settings>Saved data>Authentication
Data>Clear
4. Q&A (3/3)
How to check out an SVN directory (recursively) to
local existing folder? (Similar to get latest version in
VSS & overwrite all local)
O Should checkout to an empty working copy.
O Existing working copy may cause file conflict or leave files not
under source control.
O How to get specific version of code from SVN?
O Select file/folder in the working copy
O TortoiseSVN>Update to revision…
O Select the option Revision, input desired revision
O You can Show log to know the log message.
Any Question ?

More Related Content

What's hot

SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practicesabackstrom
 
Getting Started With Subversion
Getting Started With SubversionGetting Started With Subversion
Getting Started With SubversionJordan Hatch
 
Subversion Best Practices
Subversion Best PracticesSubversion Best Practices
Subversion Best PracticesMatt Wood
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopigopinathkarangula
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingPhilip Johnson
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best PracticesMaidul Islam
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with SubversionGuy K. Kloss
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overviewpolarion
 
Subversion
SubversionSubversion
Subversionrchakra
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With SubversionSamnang Chhun
 
Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replicationnormanmaurer
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLabPablo Arriazu
 
Mercurial Distributed Version Control
Mercurial Distributed Version ControlMercurial Distributed Version Control
Mercurial Distributed Version ControlDavid Stockton
 
Digital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationDigital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationMassimo Menichinelli
 
Subversion
SubversionSubversion
Subversionthebdot1
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & GitCraig Smith
 

What's hot (20)

SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
Getting Started With Subversion
Getting Started With SubversionGetting Started With Subversion
Getting Started With Subversion
 
SVN Best Practices
SVN Best PracticesSVN Best Practices
SVN Best Practices
 
Subversion Best Practices
Subversion Best PracticesSubversion Best Practices
Subversion Best Practices
 
SVN Basics
SVN BasicsSVN Basics
SVN Basics
 
Totalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By GopiTotalsvn Usage And Administration By Gopi
Totalsvn Usage And Administration By Gopi
 
Introduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project HostingIntroduction to Subversion and Google Project Hosting
Introduction to Subversion and Google Project Hosting
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
Version Control with Subversion
Version Control with SubversionVersion Control with Subversion
Version Control with Subversion
 
Subversion Overview
Subversion OverviewSubversion Overview
Subversion Overview
 
Subversion
SubversionSubversion
Subversion
 
Version Control With Subversion
Version Control With SubversionVersion Control With Subversion
Version Control With Subversion
 
Using svn
Using svnUsing svn
Using svn
 
Svn tutorial
Svn tutorialSvn tutorial
Svn tutorial
 
Subversion on-the-fly replication
Subversion on-the-fly replicationSubversion on-the-fly replication
Subversion on-the-fly replication
 
How to use CVS applied to SOLab
How to use CVS applied to SOLabHow to use CVS applied to SOLab
How to use CVS applied to SOLab
 
Mercurial Distributed Version Control
Mercurial Distributed Version ControlMercurial Distributed Version Control
Mercurial Distributed Version Control
 
Digital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 InformationDigital Fabrication Studio 0.3 Information
Digital Fabrication Studio 0.3 Information
 
Subversion
SubversionSubversion
Subversion
 
Version Control & Git
Version Control & GitVersion Control & Git
Version Control & Git
 

Similar to svn

Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .UnixTrong Dinh
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP DevelopersLorna Mitchell
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN TutorialenggHeads
 
FlashInTO SVN Presentation
FlashInTO SVN PresentationFlashInTO SVN Presentation
FlashInTO SVN PresentationMatthew Fabb
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego LeagueJeffrey T. Pollock
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementPhilip Johnson
 
Subversion 101: A short introduction to Subversion
Subversion 101: A short introduction to SubversionSubversion 101: A short introduction to Subversion
Subversion 101: A short introduction to SubversionVu Hung Nguyen
 
Git your life for fun & profit
Git your life for fun & profitGit your life for fun & profit
Git your life for fun & profitGeeks Anonymes
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version ControlSourabh Sahu
 
Difference between team foundation server and subversion
Difference between team foundation server and subversionDifference between team foundation server and subversion
Difference between team foundation server and subversionUmar Ali
 
version controlling in software development
version controlling in software developmentversion controlling in software development
version controlling in software developmentAnushka Perera
 

Similar to svn (20)

Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion on .Unix
Subversion on .UnixSubversion on .Unix
Subversion on .Unix
 
Subversion
SubversionSubversion
Subversion
 
Subversion
SubversionSubversion
Subversion
 
Practical SVN for PHP Developers
Practical SVN for PHP DevelopersPractical SVN for PHP Developers
Practical SVN for PHP Developers
 
SVN Tutorial
SVN TutorialSVN Tutorial
SVN Tutorial
 
subversion.ppt
subversion.pptsubversion.ppt
subversion.ppt
 
FlashInTO SVN Presentation
FlashInTO SVN PresentationFlashInTO SVN Presentation
FlashInTO SVN Presentation
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
 
SVN Information
SVN Information  SVN Information
SVN Information
 
Introduction to Version Control and Configuration Management
Introduction to Version Control and Configuration ManagementIntroduction to Version Control and Configuration Management
Introduction to Version Control and Configuration Management
 
Subversion 101: A short introduction to Subversion
Subversion 101: A short introduction to SubversionSubversion 101: A short introduction to Subversion
Subversion 101: A short introduction to Subversion
 
Git your life for fun & profit
Git your life for fun & profitGit your life for fun & profit
Git your life for fun & profit
 
Subversion
SubversionSubversion
Subversion
 
Git your life for fun & profit
Git your life for fun & profitGit your life for fun & profit
Git your life for fun & profit
 
Subversion
SubversionSubversion
Subversion
 
Understanding GIT and Version Control
Understanding GIT and Version ControlUnderstanding GIT and Version Control
Understanding GIT and Version Control
 
ClearCase Basics
ClearCase BasicsClearCase Basics
ClearCase Basics
 
Difference between team foundation server and subversion
Difference between team foundation server and subversionDifference between team foundation server and subversion
Difference between team foundation server and subversion
 
version controlling in software development
version controlling in software developmentversion controlling in software development
version controlling in software development
 

svn

  • 2. Discussion point. O Concept of version control & SVN? O Common Function in Tortoise SVN? O Best Practices O Q & A O Any Questions ??
  • 3. 1. Concept of version control & svn O What is version control ? O Versioning model O What is SVN ? O How to use svn? O Svn client and plugins.
  • 4. 1.1 what is version control ? O The management of changes to information (physical: files). O Allow concentrating and sharing files over the network. O Support authority and security. O Cooperate member’s changes. O Manage files with version, allow recovering of desired version. O Allow checking the modification. O Support CM(Configuration Management) process.
  • 5. 1.2. Versioning models(1/2) O Files -sharing without control. One's data may be accidentally overwritten by other
  • 6. 1.2. Versioning models(1/2) O Lock-modify-unlock solution: weak point is not allow many persions to work on the same file at the same time.
  • 7. 1.2. Versioning models(2/2) O Copy-Modify-Merge solution (SVN recommended): Allow many persons to work on the same file at the same time, but must apply file merging before submitting.
  • 9. How to Use Version Control client server send current revision ( n ) (do some work, test) check status any changes since revision n? update update your local copy with any changes in the repo. (resolve conflicts) commit (do more work, test) save your changes and log entry
  • 10. 1.3 What is SVN ? O Subversion (abbreviated SVN) is a free open-source version control system. O Managed folders/files are placed into a repository. A repository is much like an ordinary file server. O Can operate across networks,which allows it to be used by people on different computers.
  • 12. 1.3 SVN Layout tags branches trunk Project 1 Root Project 2 tags branches trunk tags trunk Project 1 Repository parent dir Project 2 tags trunk One project per repository branches branches
  • 13. URLs and Protocols http://myhost.com:port/path/to/repository Protocol: svn svn+ssh http https file Host name or IP address 127.0.0.1 localhost host:8443 Repository relative path optional port number
  • 14. Why use svn ? O Sufficient features O Free / Open Source O Support Windows, UNIX, Linux, Mac OS O Large community: many clients/shells (TortoiseSVN, Syncro, SmartSVN…), many plugins (VS .NET, Eclipse, XCode IDE…) O Plain file formats: allow to recover data when repository broken O Good performance (on-debate)
  • 15. 1.4. Svn Client and plugins O SVN Client for Windows: SVN Plugin for Eclipse: O (http://tortoisesvn.tigris.org) http://subclipse.tigris.org/ O
  • 16. 2. Common function in Tortoise SVN O Setup TortoiseSVN, grant access right O Browse repository O Check out a working copy O Add file/folder to repository O Lock/Release repository files O Commit to repository O Check modification O Update working copy O Revision log dialog O View differences O Clean up
  • 17. Common Function in TortoiseSVN
  • 18. 2.1. Setup USVN, grant access right (1/2)
  • 19. 2.1. Setup SVN Project repository, (1/2)
  • 20. 2.2 Browser Repository O In Windows Explorer, right click > TortoiseSVN > Repo- browser O Put the repository URL into the dialog box Login with given username and password
  • 21. 2.2 Browser Repository O The Repo-browser opened
  • 22. 2.3. Add file/folder to repository O A. Without (local) working copy folder O In Repo-browser, right click>Add folder… O Select source file/folder to be added => New files/folders will be added under current selected folder.
  • 23. 2.3. Add file/folder to repository B. With (local) working copy folder (recommended) ➢ Copy new file/folder to the working copy folder ➢In Windows Explorer, select new file/folder,right click>TortoiseSVN>Add… ➢TortoiseSVN>Commit…=> New file/folder has a check mark.
  • 24. 2.4. checkout working copy O SVN: Checkout (head rev.) = VSS: Get latest version O In Windows Explorer, select working folder, right click>SVN Checkout… OR O In Repo-browser, select the folder to check out, right click>Checkout… Desired revision
  • 25. 2.5. Lock / Release repository files(1/2) O SVN: Checkout + Lock = VSS: Check-out This is to avoid the conflict when another user updates the repository while you are working on your working copy. O How to: In the working copy, select file to lock, right-click>TortoiseSVN>Get lock… => Locked file has a lock-icon mark. Other users will not be able to commit until you release the locked files.
  • 26. 2.5. Lock / Release repository files(2/2) O This is to release the locked files for others to commit. How to: O Select locked file>TortoiseSVN>Release lock Steal the locks: O Select locked file>TortoiseSVN> O Get lock… O - Check Steal the locks This way will steal other’s lock and replace by your lock. Not recommended. It’d be better to ask the author to release his lock
  • 27. 2.6. Commit to Repository O SVN: Commit = VSS: Check-in O This is to send the changes you made on working copy to the repository. How to: O On the working copy, right click>SVN Commit… O Before committing, you should make sure that your working copy is up-to-date. Should give comments
  • 28. 2.7. Check Modification O This is to know the modification status of selected file in comparison with that file on the repository. How to: O On working copy, select modified file O right click>TortoiseSVN>Check for modifications The Working Copy dialog shows the status of the selected files in comparison with that file on the repository.
  • 29. 2.8. Update Working copy O SVN: Update = VSS: Get latest version O This is to update your working copy with new changes on the repository. O Periodically, you should ensure that changes done by others get incorporated in your working copy. How to: O On the working copy, select folder to be updated, right click>SVN Update…
  • 30. 2.9 show Revision log message O For every change you make and commit, should provide a log message describes the meaning of your change. O The Log Messages dialog retrieves all those log messages and allows you to select the desired revision. O Revision number is applied for the whole repository.
  • 31. 2.10 View Differences O Compare working copy with a given SVN revision. How to: O On working copy, select file to compare O Right click>Show log => Log messages dialog opened O Select the revison to compare, right click>Compare with local copy
  • 32. 2.11 Clean up O If a Subversion command cannot complete successfully, perhaps due to server or network problems, your working copy can be left in an inconsistent state. O It is a good idea to do “clean up” at the top level of the working copy.
  • 33. 2.12 Status of version controlled files/folders O Green checkmark: normal status, under control O Red exclamation: file has been modified since last update and needs to be committed. O Yellow exclamation: a conflict occurs during an update. O Grey checkmark: this file needs to be locked first before editing. O Locked : file is locked. Need to unlock for other to commit. O Red deletion: missing file or file to be deleted under version control. O Blue plus: File to be added to version control.
  • 34. 2.13 Check for conflict O If there are any changes on the server, then you should "update" your working copy before "commit"-ing your changes.
  • 35. 2.14 Resolve Conflicts O "Conflict" means you have made changes to a file, and the version in the repository has been changed, too. O So there is a "conflict" between your work and work already in the repository. O Subversion client creates 4 files when a conflict exists.
  • 36. 2.14 Resolve Conflict Edit-Conflict tool of TortoiseSVN
  • 37. 2.14 Resolve Conflict The choices are: (1) merge local & remote changes into one file. (2) accept remote, discard your local changes. (3) override remote, use your local changes. O After resolving all conflicts, mark the file as "resolved". O Subversion will delete the extra 3 copies.
  • 38. 2.14 Resolving Conflicts in Eclipse O Use "Compare Editor" in Synchronize perspective. O Accept or reject changes one-by-one or all at once.
  • 39. 3. Best Practices O Best practices for the correct-usage O Avoid conflict over multi-user repository O Enforce control and cooperation among team
  • 40. 3. Best Practices(1/5) O Give comments for the commit O Professional working style. O Give the meaning for the update you made. O Help to find the desired revision quickly. O Update latest version before committing O To assure your update is made on the latest version of the repository. O Right-click>SVN Update
  • 41. 3. Best Practices (2/5) O Self-manage the merging, do not let TortoiseSVN to merge files O In case there is conflict between your working copy and the repository, you should merge file by yourself. O Steps: O Perform Update => TortoiseSVN creates 3 files: your original file, the latest file from repository and the SVN merged file. O Don’t use the merged file. O Manually compare and merge your original file with latest file. O Overwrite your result onto the SVN merged file. O Commit your merged file to the repository
  • 43. 3. Best Practices (4/5) O Checkout-Lock-Edit-Commit-Unlock (VSS: single checkout) O Apply the auto need-lock property. O How to use? O Before editing one file, perform Get lock => file is ready to update, also the repository file is locked so the other cannot commit their changes. O Commit your file after editing O Release lock => the other can edit and commit their changes. O Do not use Windows Explorer to set file attributes.
  • 44. 3. Best Practices (5/5) O Use TortoiseSVN commands (right click, drag and drop) don not use the Windows Explorer commands. O This to keep the consistency between your working copy to the repository. The actions have effect on both your working copy and repository.
  • 45. 4. Q&A (1/3) How to obtain a “clean” working copy (original sources only) and exclude .svn folders. O Select working copy>right-click>TortoiseSVN>Export O Provide the destination folder for the “clean” working copy How to leave (ignore) the files/folders not in source control O Select files/folders in working copy not in source control O Right-click>TortoiseSVN>Add to ignore list How to add “free” files/folders (in working copy) into source control O Select files/folders>right-click>TortoiseSVN>Add O Commit the working copy
  • 46. 4. Q&A (2/3) How to break/steal lock O This is to break the locking on file by override the locking author. O Check for modifications>select locked files>break lock, OR O Right click>TortoiseSVN>Get lock, check the Steal option, OK. O Recommend: should not use this function unless you have agreement of the PM Cannot login because of wrong SSL cache: clear cache O First login to a wrong/forbidden link failed => wrong SSL is cached O Later login (to correct link) also failed because the TortoiseSVN use the wrong cached SSL. O Solution: right click>TortoiseSVN>Settings>Saved data>Authentication Data>Clear
  • 47. 4. Q&A (3/3) How to check out an SVN directory (recursively) to local existing folder? (Similar to get latest version in VSS & overwrite all local) O Should checkout to an empty working copy. O Existing working copy may cause file conflict or leave files not under source control. O How to get specific version of code from SVN? O Select file/folder in the working copy O TortoiseSVN>Update to revision… O Select the option Revision, input desired revision O You can Show log to know the log message.