Introduction to SVN concepts and Best Practices
Benefits
Version control system is designed to
 Track your changes to show them you really are working
 Rollback mistakes without rolling on your rifle in despair
 Experiment safely without breaking the “real” code base

 Collaborate sanely with both “Lone Wolves” and “Dream

Teams”
 Directory/file renaming and versioning
 Automatic merge/merge tracking

 Atomic Commits
How it Works?
In Simple Steps this is the plan
 Repository contains the
combined code of all
developers
 Working copies are developers
own files at same stage
 Dev1/Dev2 saves his/her copy
on repository after completing
 All developers will always
work on updated code on
Repository
 And Team can maintain
versions

Repository

Dev1
Working
Copy

Dev2
Working
Copy
File structure
No collaboration and manual
merging


Normal Project

Your Project structure
Myproject
/All Files

Everything you need to work in a
team as a developer is
automated


When Using SVN

Project structure on svn
Myproject
/ trunk
/All Files
/ tags
/ branches
What is Trunk, Branch and Tag?

Trunk Contains the main code
Branch is an experimental version for any code changes
Tag should not be modified or worked upon, its for saving a workable version of the
project
Work flow of a team
Check Out
/Update

Modifications

Commit

Tag

• Use it for downloading the project code base for first time
• Create a branch
• Update the code base before start working

• Start writing the code
• Make sure you are working on branch

• Don’t commit unfinished functionalities
• Write message for every commit
• Might get conflicts/collision with the files and line numbers, handled by devs

• If the build is stable create a Tag
• Or merge the branch you are working on with the trunk files
Basic actions


Based on your SVN client, you need to practice the
following basic actions on the 'trunk‘ or ‘Branches’
folder:
Add / commit.
Update / commit.
Modify / Revert.
Modify several files / commit all with same message.
View revision graph / view log.
Compare between versions / Show differences.
Add folder recursively.
Update local copy to specific revision not just head.
Delete / commit – Delete / revert deletion.



You need to get used for the icons on files for your
favorite SVN client, Refer the next Slide
Indicators and their meanings
Basic actions


Continue to practice the following tasks:
Lock – Modify – Unlock to prevent anyone from
changing in file while you are modifying it.
Export to be used when releasing for taking
version in ‘Tags’ folder.
Try the blame feature to view changes for each
line is done by whom.
Best Practices






Trunk will always contain the latest code
do Small bug fixes on the trunk
Always do update, before start working
Avoid making Typos as it will affect the repository
If you are doing lot of changes in the code or new modules
/ functionalities create a branch
 If Build(Branch) is stable merge it with trunk , and create
TAG for saving that build version
 Before committing do a unit test
 Always write a meaning comment when you do a commit,
 Eg. Made changes in the print invoice : created …..
 Branch creation or tag creation is manual, whole team takes a

call on that
Understanding the Functions in
depth
Advance Functions
Examples
Examples Checkout
Examples: Update
Examples: Add
Examples : Changelog
Thank You

SVN Basics

  • 1.
    Introduction to SVNconcepts and Best Practices
  • 2.
    Benefits Version control systemis designed to  Track your changes to show them you really are working  Rollback mistakes without rolling on your rifle in despair  Experiment safely without breaking the “real” code base  Collaborate sanely with both “Lone Wolves” and “Dream Teams”  Directory/file renaming and versioning  Automatic merge/merge tracking  Atomic Commits
  • 3.
    How it Works? InSimple Steps this is the plan  Repository contains the combined code of all developers  Working copies are developers own files at same stage  Dev1/Dev2 saves his/her copy on repository after completing  All developers will always work on updated code on Repository  And Team can maintain versions Repository Dev1 Working Copy Dev2 Working Copy
  • 4.
    File structure No collaborationand manual merging  Normal Project Your Project structure Myproject /All Files Everything you need to work in a team as a developer is automated  When Using SVN Project structure on svn Myproject / trunk /All Files / tags / branches
  • 5.
    What is Trunk,Branch and Tag? Trunk Contains the main code Branch is an experimental version for any code changes Tag should not be modified or worked upon, its for saving a workable version of the project
  • 6.
    Work flow ofa team Check Out /Update Modifications Commit Tag • Use it for downloading the project code base for first time • Create a branch • Update the code base before start working • Start writing the code • Make sure you are working on branch • Don’t commit unfinished functionalities • Write message for every commit • Might get conflicts/collision with the files and line numbers, handled by devs • If the build is stable create a Tag • Or merge the branch you are working on with the trunk files
  • 7.
    Basic actions  Based onyour SVN client, you need to practice the following basic actions on the 'trunk‘ or ‘Branches’ folder: Add / commit. Update / commit. Modify / Revert. Modify several files / commit all with same message. View revision graph / view log. Compare between versions / Show differences. Add folder recursively. Update local copy to specific revision not just head. Delete / commit – Delete / revert deletion.  You need to get used for the icons on files for your favorite SVN client, Refer the next Slide
  • 8.
  • 9.
    Basic actions  Continue topractice the following tasks: Lock – Modify – Unlock to prevent anyone from changing in file while you are modifying it. Export to be used when releasing for taking version in ‘Tags’ folder. Try the blame feature to view changes for each line is done by whom.
  • 10.
    Best Practices      Trunk willalways contain the latest code do Small bug fixes on the trunk Always do update, before start working Avoid making Typos as it will affect the repository If you are doing lot of changes in the code or new modules / functionalities create a branch  If Build(Branch) is stable merge it with trunk , and create TAG for saving that build version  Before committing do a unit test  Always write a meaning comment when you do a commit,  Eg. Made changes in the print invoice : created …..  Branch creation or tag creation is manual, whole team takes a call on that
  • 11.
  • 15.
  • 18.
  • 23.
  • 26.
  • 34.
  • 36.
  • 38.