Subversion

From Embedded Xinu
Revision as of 19:24, 1 September 2006 by Michael (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 file:///usr/local/project/EmbeddedOS/repo/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.