Your SlideShare is downloading. ×
0
Introduction to Subversion (SVN) Presented by Waqqas Jabbar 1 st  January 2009
Questions <ul><li>What do you know about Version Control ? </li></ul><ul><li>What do you know about CVS? </li></ul><ul><li...
Version Control <ul><li>Maintaining different versions of a file </li></ul><ul><li>Version Control system records changes ...
Version Control <ul><li>Client-Server architecture </li></ul><ul><li>Server maintains the version of files </li></ul><ul><...
Typical Usage Flow <ul><li>User1 gets File1 from Server (CHECK-??) </li></ul><ul><ul><li>S->[V0], U1->[V0] </li></ul></ul>...
Installation <ul><li>Its already installed :) </li></ul><ul><li>Common utilities </li></ul><ul><ul><li>svnadmin – Administ...
Configuration - Basic <ul><li>Starting service </li></ul><ul><ul><li>cp svn /etc/init.d (svn script provided) </li></ul></...
Configuration - Basic <ul><li>Configuration </li></ul><ul><ul><li>vi svnserve.conf </li></ul></ul><ul><ul><ul><li>password...
Configuration - Adding a new user <ul><li>cd /opt/svn/conf </li></ul><ul><li>vi passwd </li></ul><ul><ul><li>Add username=...
Configuration - Setup authorization <ul><li>Cd /opt/svn/conf </li></ul><ul><li>Vi authz </li></ul><ul><ul><li>Add groups <...
Importing a project <ul><li>cd project_root_dir </li></ul><ul><li>svn import . svn://localhost/proj3 </li></ul>
Checking out <ul><li>Svn checkout svn://localhost/proj3 –username user1 </li></ul>
Updating a project <ul><li>svn update </li></ul><ul><li>Current directory and its subdirectories will be updated </li></ul>
Conflict Management <ul><li>Conflict occur if two user change the same line in the same file </li></ul><ul><li>Conflict ca...
Getting current status <ul><li>svn status </li></ul><ul><ul><li>A – File added in local copy but need to uploaded to the s...
Deleting file <ul><li>svn rm file_name </li></ul>
Thank You
Upcoming SlideShare
Loading in...5
×

Introduction To SVN

696

Published on

Basic introduction on how to install and use SVN for your projects

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
696
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
10
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Introduction To SVN"

  1. 1. Introduction to Subversion (SVN) Presented by Waqqas Jabbar 1 st January 2009
  2. 2. Questions <ul><li>What do you know about Version Control ? </li></ul><ul><li>What do you know about CVS? </li></ul><ul><li>What do you know about SVN ? </li></ul>
  3. 3. Version Control <ul><li>Maintaining different versions of a file </li></ul><ul><li>Version Control system records changes in </li></ul><ul><ul><li>File </li></ul></ul><ul><ul><ul><li>Addition </li></ul></ul></ul><ul><ul><ul><li>Removal </li></ul></ul></ul><ul><ul><ul><li>Modification </li></ul></ul></ul><ul><ul><li>Directory </li></ul></ul><ul><ul><ul><li>Addition </li></ul></ul></ul><ul><ul><ul><li>Removal </li></ul></ul></ul><ul><ul><ul><li>Modification </li></ul></ul></ul><ul><li>Vital for any software project of any reasonable size </li></ul>
  4. 4. Version Control <ul><li>Client-Server architecture </li></ul><ul><li>Server maintains the version of files </li></ul><ul><li>Everyone that is working on the file gets a local copy on his/her system (CHECK-OUT) </li></ul><ul><li>He/she changes the local copy </li></ul><ul><li>He/she uploads the changes on the server ( CHECK-IN or COMMIT) </li></ul><ul><li>Others merge the changes on the server with their local copy (UPDATE) </li></ul>
  5. 5. Typical Usage Flow <ul><li>User1 gets File1 from Server (CHECK-??) </li></ul><ul><ul><li>S->[V0], U1->[V0] </li></ul></ul><ul><li>User2 gets File1 from Server (CHECK-???) </li></ul><ul><ul><li>S->[V0], U2->[V0] </li></ul></ul><ul><li>Both users make changes in File1 </li></ul><ul><ul><li>S->[V0] </li></ul></ul><ul><li>User1 uploads his changes on the server (CHECK-??) </li></ul><ul><ul><li>S->[V1], U1->[V1], U2->[V0] </li></ul></ul><ul><li>User2 merges her changes in local copy with server (UPDATE) </li></ul><ul><ul><li>S->[V1], U1->[V1], U2->[V1] </li></ul></ul>
  6. 6. Installation <ul><li>Its already installed :) </li></ul><ul><li>Common utilities </li></ul><ul><ul><li>svnadmin – Administration utility </li></ul></ul><ul><ul><li>svn - Client </li></ul></ul><ul><ul><li>svnserve - Server </li></ul></ul><ul><ul><li>svnversion – Client utility to get current version number </li></ul></ul><ul><ul><li>Sum more utilities </li></ul></ul>
  7. 7. Configuration - Basic <ul><li>Starting service </li></ul><ul><ul><li>cp svn /etc/init.d (svn script provided) </li></ul></ul><ul><ul><li>ln -s /etc/rc5.d/S61svn /etc/init.d/svn </li></ul></ul><ul><ul><li>ln -s /etc/rc6.d/K51svn /etc/init.d/svn </li></ul></ul><ul><ul><li>Edit /etc/init.d/svn (change /opt/svn with the path of the repository) </li></ul></ul><ul><ul><li>service svn start </li></ul></ul><ul><li>Setting repository </li></ul><ul><ul><li>svnadmin create -fs-type fsfs /opt/svn </li></ul></ul><ul><ul><ul><li>/opt/svn will contain all the svn related files </li></ul></ul></ul><ul><ul><ul><li>Better to have /opt/svn in another partition </li></ul></ul></ul><ul><ul><ul><ul><li>Easy to recover in case of crash </li></ul></ul></ul></ul>
  8. 8. Configuration - Basic <ul><li>Configuration </li></ul><ul><ul><li>vi svnserve.conf </li></ul></ul><ul><ul><ul><li>password-db=passwd </li></ul></ul></ul><ul><ul><ul><li>Authz-db=authz </li></ul></ul></ul>
  9. 9. Configuration - Adding a new user <ul><li>cd /opt/svn/conf </li></ul><ul><li>vi passwd </li></ul><ul><ul><li>Add username=password </li></ul></ul>
  10. 10. Configuration - Setup authorization <ul><li>Cd /opt/svn/conf </li></ul><ul><li>Vi authz </li></ul><ul><ul><li>Add groups </li></ul></ul><ul><ul><ul><li>Team1=user1,user2 </li></ul></ul></ul><ul><ul><ul><li>Team2=user3,user4 </li></ul></ul></ul><ul><ul><li>Define authorization on different groups </li></ul></ul><ul><ul><ul><li>Team1 = rw </li></ul></ul></ul><ul><ul><ul><li>* = r </li></ul></ul></ul>
  11. 11. Importing a project <ul><li>cd project_root_dir </li></ul><ul><li>svn import . svn://localhost/proj3 </li></ul>
  12. 12. Checking out <ul><li>Svn checkout svn://localhost/proj3 –username user1 </li></ul>
  13. 13. Updating a project <ul><li>svn update </li></ul><ul><li>Current directory and its subdirectories will be updated </li></ul>
  14. 14. Conflict Management <ul><li>Conflict occur if two user change the same line in the same file </li></ul><ul><li>Conflict can occur during update and commit </li></ul><ul><li>Both changes are present in the file with conflict </li></ul><ul><li>How to remove conflict </li></ul><ul><ul><li>Edit the file with the required changes </li></ul></ul><ul><ul><li>svn resolved file_name </li></ul></ul>
  15. 15. Getting current status <ul><li>svn status </li></ul><ul><ul><li>A – File added in local copy but need to uploaded to the server </li></ul></ul><ul><ul><li>M - File modified in local copy but need to uploaded to the server </li></ul></ul><ul><ul><li>D - File deleted from local copy but need to uploaded to the server </li></ul></ul><ul><ul><li>? - File not in version control </li></ul></ul>
  16. 16. Deleting file <ul><li>svn rm file_name </li></ul>
  17. 17. Thank You
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×