Difference between revisions of "Subversion"

From Embedded Xinu
Jump to navigation Jump to search
(New repo path)
m (mulug->xinu)
Line 5: Line 5:
  
 
To check out your branch into the directory of your choice, type
 
To check out your branch into the directory of your choice, type
  svn checkout svn+ssh://svn@mulug/xinu-mips/trunk ~/xinu-mips
+
  svn checkout svn+ssh://svn@xinu/xinu-mips/trunk ~/xinu-mips
 
of course ~/xinu-mips can be whatever directory you wish to store your code.
 
of course ~/xinu-mips can be whatever directory you wish to store your code.
  

Revision as of 01:51, 17 January 2008

Within the repo directory

/usr/local/project/EmbeddedOS/repo

If you even forget a subversion command there are some posted in the 310 lab, or you can come here.

To check out your branch into the directory of your choice, type

svn checkout svn+ssh://svn@xinu/xinu-mips/trunk ~/xinu-mips

of course ~/xinu-mips can be whatever directory you wish to store your code.

Now you have a private working copy of your branch in ~/xinu-mips.

Most svn commands should be executed from your working copy, so lets

cd ~/xinu-mips

The first thing you will want to do before you start working is run:

svn update

or

svn up

this will update all the files any one may have changed.

Along with update, when you finish making changes you must commit them, this is done with

svn commit

or

svn ci

This should open up the editor of your choice (well whatever the system variable $EDITOR is set to), and you can type a log message which catalogs the changes you made.

Before you commit you should usually run

svn status

or

svn st

to see what changes are going to be made. Each change is pre-pended with a character, usually M but sometimes it can be ?, !, A, or D (there are more, but they are less common). ? means svn is unsure what to do, odds are you have added that file since the last update, you must tell svn to add it by running

svn add <file-path>

! similarly means that the file is missing and you probably deleted it, so

svn rm <file-path>

should do the trick, these commands will change the ? or ! into A or D, respectively.

Another important letter is C, which means conflict and that you have to figure out what went wrong with the file, if you didn't make any huge changes or don't mind losing your changes you can

svn revert <file-path>

to revert to the latest revision you have, otherwise I suggest reading up on it through svn help or the Internet.

You can type svn help for a list of commands and

svn help <command>

for help on a specific command.

I think that covers the majority of command to be used, if you want to know more you can go to <http://svnbook.red-bean.com/en/1.2/svn-book.html> which has everything you want.