svn Basics Department of Computer Science Kent State University Prof Jonathan I Maletic Version Control svn is a tool for version control of files Keeps a repository of what is under control at a central location ID: 562005
Download Presentation The PPT/PDF document "Subversion (" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Subversion (svn)Basics
Department of Computer Science
Kent
State University
Prof. Jonathan I. MaleticSlide2
Version Controlsvn
is a tool for version control of files
Keeps a repository of what is under control at a central location
Allows users to make local (aka working) copies of the repository on their machine or file system
Saves each version a user commits
Administrator sets up main repository.Slide3
Getting and Updating
Checkout
a repository. A local/working copy of a repository is created on a machine or file system. This links a given folder to the address of the repository.
svn
checkout
address
folder
Update
a local/working copy. The contents of the repository are copied to the local folder. This updates the local copy.
svn
updateSlide4
Committing ChangesCommit
a
change. Copy a local change to repository. This commits a change to the repository. This is a new version of the item under version control. It is numbered and the old version is saved. Need to commit:
Modified
files
Added or removed files
or
folders
svn
commit
file
–m “
Commit note
”Slide5
Other Essential Commands
svn
add
– add a file. A commit must be done after the add to commit it to the repository.
svn
delete
– delete a file, followed by a commit.
svn
log
– get all the commit messages. Use this to roll back to an earlier version.Slide6
Check Out Working Copy
Machine:
svn
svn
Server
Machine: wasp
Logged On
cs23001/svn
jmaletic
/
cs23001/
copy
svn
co …/
svn
/
jmaletic
/ cs23001
svn updateSlide7
Add & Commit
Machine:
svn
svn
Server
Machine: wasp
Logged On
cs23001/svn
jmaletic
/
cs23001/
emacs
M
ain.cpp
svn
add
Main.cpp
Main.cpp
svn
ci –
M”Added
main”
Main.cpp
CopySlide8
Commit a Change
Machine:
svn
svn
Server
Machine: wasp
Logged On
cs23001/svn
jmaletic
/
cs23001/
touch
Main.cpp
Main.cpp
svn
ci –
M”Modified
main”
Main.cpp
Copy
Main.cpp
V2
Main.cpp
V2Slide9
Multiple Working Copies
Machine:
svn
svn
Server
Machine: wasp
cs23001/svn
jmaletic
/
cs23001/
Main.cpp
V2
Main.cpp
V2
Machine:
Labtop
Logged On
cs23001/
Main.cpp
V2
svn
co …/
svn
/
jmaletic
/ cs23001
svn
update
copySlide10
Commit a Change
Machine:
svn
svn
Server
Machine: wasp
cs23001/svn
jmaletic
/
cs23001/
Main.cpp
V2
Main.cpp
V2
Machine:
Labtop
Logged On
cs23001/
Main.cpp
V2
touch
Main.cpp
svn
ci –
m”change
to main”
Main.cpp
V3
Copy
Main.cpp
V3Slide11
Update wasp
Machine:
svn
svn
Server
Machine: Laptop
cs23001/svn
jmaletic
/
cs23001/
Main.cpp
V3
Machine: wasp
Logged On
cs23001/
Main.cpp
V2
svn
update
Main.cpp
V3
Main.cpp
V3
copySlide12
Web Interface
Machine:
svn
svn
Server
Browser
cs23001/svn
jmaletic
/
cs23001/
Main.cpp
V3
Main.cpp
V3
https://svn.cs.kent.edu/courses/cs23001/svn/jmaleticSlide13
Rules to Live By (svn)
Always
update
before you start working
Always
commit
after changes
Commit often – after a major (or minor) change:
Add a method
Fix a bug
Change a method