User Tools

Site Tools


user:afassett:hpc_ii:subversion

howto on lab46 per-user subversion repositories

Objective

The goal here is to learn about subversion and to use the repository.

Materials

  • Some intelligence
  • The ability to read
  • The Ability to remember

Background

Many people don't know about svn and don't use it. However it makes coding easier by backing it up and simpler to improve. Sometimes improving a system you have to take a few steps back and with svn you can. It also making coding easier to share and be shared. Having friends help you gets the work done quicker and lets people see what your doing so everyone gains!!

Procedure

“Always remember to svn commit”
Where it says “filename” input any filename appropriate to your situation.
ONLY IN CASE OF EMERGENCY! (delete directory than svn co URL)

The Basics

Adding files.)

svn add //filename//


Removing files.)

svn rm //filename// 

(remove and rm both work).

Moving/Copy files.)

svn mv/cp //filename// 

(move and copy work as well)

To make any changes permanent to the repository you have to COMMIT

svn commit //filename// -m "message describing your changes to the repository"

If no filename given commit will take what files you have changed, based on where you are. So if you want to commit a large some of files in a project just be in the parent directory for your project. Committing without -m argument will prompt you to vi, where you can write out more detail of your commit.

resolve conflicts.)

svn resolve --accept=mine-full //filename//

Is not important in the basics to look at differences of the two files in conflict but that it simply gets resolved. Remember it's a repository, versions of the file are saved and can be recalled. The argument “mine-full” can be changed to “theirs-full” if you really feel that it's not the one to commit.
status of your work.)

svn status

should show knowing if you remembered to commit and no conflicts. “?” means the repository doesn't know what the file is and need to be added than committed. If a 'C' is next to a line it is a conflict the needs to be resolved.
History of commits.)

svn log

Shows a history of everyone who's committed and their messages.
HELP!!.)

 svn --help 

Just ? or h will work as well.

Advance skills

revert back.)

svn revert //filename//

undo changes on files but haven't been committed yet.
list of files.)

svn list

lists all the files and directories add to the repository.

References

user/afassett/hpc_ii/subversion.txt · Last modified: 2011/05/13 01:13 by afassett