svn
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
svn [2007/03/27 14:32] – damir | svn [2010/05/06 10:41] – damir | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== Subversion ==== | + | ====== Subversion |
Subversion is an open-source control version system that is a compelling replacement for CVS. At least the client version is installed by default on all our Linux machines, and can be easily installed on Macs via [[http:// | Subversion is an open-source control version system that is a compelling replacement for CVS. At least the client version is installed by default on all our Linux machines, and can be easily installed on Macs via [[http:// | ||
Line 10: | Line 10: | ||
</ | </ | ||
where '' | where '' | ||
+ | |||
+ | |||
+ | ===== Standard connection methods for our central repositories ===== | ||
For group projects, it is better to use the common repository which is | For group projects, it is better to use the common repository which is | ||
* for algo: < | * for algo: < | ||
- | * for licos: < | + | * for licos: < |
- | * for lthc: < | + | * for lth: < |
- | * for lcm: < | + | * for lcm: < |
+ | * for arni: < | ||
- | === Quick User Guide === | + | ===== Quick User Guide ===== |
Almost everything is done with the '' | Almost everything is done with the '' | ||
Line 26: | Line 30: | ||
**The most common svn commands are:** | **The most common svn commands are:** | ||
- | == svn help [command name] == | + | ==== svn help [command name] ==== |
I think you've guessed what it is for. Use it ! | I think you've guessed what it is for. Use it ! | ||
- | == svn list URL == | + | ==== svn list URL ==== |
to list the content of the [remote] repository. For example: | to list the content of the [remote] repository. For example: | ||
< | < | ||
Line 51: | Line 55: | ||
</ | </ | ||
- | == svn checkout URL [localdir]== | + | ==== svn checkout URL [localdir] |
to get a local copy of [part of] the repository. For example, with | to get a local copy of [part of] the repository. For example, with | ||
< | < | ||
Line 60: | Line 64: | ||
will just use the name of the last directory in the repository (in this case " | will just use the name of the last directory in the repository (in this case " | ||
- | ==svn status [-u]== | + | ==== svn status [-u] ==== |
checks the status of my local copy. Without the -u option it only works locally so it does not tell if some of the file was modified in the repository. Still very useful to see what files I have modified. The command output something only if there is something interesting to say. No output means that there are no changes. For each //changed// file flag letters appears on the left (see svn help status for a full list). The most common letters are '' | checks the status of my local copy. Without the -u option it only works locally so it does not tell if some of the file was modified in the repository. Still very useful to see what files I have modified. The command output something only if there is something interesting to say. No output means that there are no changes. For each //changed// file flag letters appears on the left (see svn help status for a full list). The most common letters are '' | ||
For example (this is the algo web site): | For example (this is the algo web site): | ||
Line 82: | Line 86: | ||
This tells me that I've modified (M) the file intro.php and that various other files are newer (*) on the repository. | This tells me that I've modified (M) the file intro.php and that various other files are newer (*) on the repository. | ||
- | ==svn update [filename]== | + | ==== svn update [filename] |
take new version of the file (of of all files if no filename is given) from the repository. It can happens that a file was modified on the repository, but also in your local copy. In this case, subversion tries to merge the two version. If it cannot, then a conflict is generated and you'll have multiple copies of the same file. You will need to resolve the conflict by choosing the correct version of the file, and running '' | take new version of the file (of of all files if no filename is given) from the repository. It can happens that a file was modified on the repository, but also in your local copy. In this case, subversion tries to merge the two version. If it cannot, then a conflict is generated and you'll have multiple copies of the same file. You will need to resolve the conflict by choosing the correct version of the file, and running '' | ||
- | ==svn commit -m " | + | ==== svn commit -m " |
commit your changes: send a copy of the files that you've modified back to the server. In case, there are files in the repository that are newer than those being committed, the commit will fail and you will have to first update your copy (and eventually resolve the conflicts). | commit your changes: send a copy of the files that you've modified back to the server. In case, there are files in the repository that are newer than those being committed, the commit will fail and you will have to first update your copy (and eventually resolve the conflicts). | ||
- | ==svn add filename== | + | ==== svn add filename |
schedule a local file for being added to the repository. The file will be actually added only when you commit your changes. | schedule a local file for being added to the repository. The file will be actually added only when you commit your changes. | ||
- | ==svn delete filename== | + | ==== svn delete filename |
schedule a file for " | schedule a file for " | ||
the repository. | the repository. | ||
Line 101: | Line 105: | ||
rename a file or a directory either locally (that is schedule the change for the next commit) or directly on the repository. | rename a file or a directory either locally (that is schedule the change for the next commit) or directly on the repository. | ||
- | ==svn log filename== | + | ==== svn log filename |
prints the history of a file. Each time the file was modified and committed | prints the history of a file. Each time the file was modified and committed | ||
< | < | ||
Line 137: | Line 141: | ||
</ | </ | ||
- | === Few general recommendations === | + | ===== New Repositories ===== |
- | - try to import into subversion ONLY the SOURCES and not the files that are generated from the sources; | + | |
+ | you can always create a personal repository in your homedir by doing: | ||
+ | |||
+ | - ssh into server: < | ||
+ | - Create empty repository: < | ||
+ | |||
+ | <note warning> | ||
+ | General repositories, | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Few general recommendations | ||
+ | - try to import into subversion ONLY the SOURCES and not the files that are generated from the sources; | ||
- try to keep the repository as clean as possible. If the repository is shared among various users, it is better to meet once and agree on a common strategy for file/ | - try to keep the repository as clean as possible. If the repository is shared among various users, it is better to meet once and agree on a common strategy for file/ | ||
- Unless you have a good reason, do not commit incomplete or buggy files; | - Unless you have a good reason, do not commit incomplete or buggy files; | ||
+ | - **Important: | ||
+ | ===== Various Tips & Tricks ===== | ||
+ | ==== Global Configuration ==== | ||
+ | Every user has a personal global SVN configuration file which resides in '' | ||
+ | The two most useful options are probably '' | ||
+ | < | ||
+ | global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store \ | ||
+ | | ||
+ | </ | ||
+ | to ignore the specified files. The command '' | ||
+ | One should be careful with '' | ||
+ | svn st --no-ignore | ||
+ | |||
+ | The option '' | ||
+ | < | ||
+ | [auto-props] | ||
+ | *.m = svn: | ||
+ | *.tex = svn: | ||
+ | </ | ||
+ | makes Subversion to automatically set the '' | ||
+ | $Id: sufficiency.tex 372 2008-02-11 16:10:53Z kleiner $ | ||
+ | ==== Per-Directory Ignore List ==== | ||
+ | While the '' | ||
+ | svn propedit svn:ignore . | ||
+ | (the '' |
svn.txt · Last modified: 2012/02/17 15:54 by damir