Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
becki:linux:svn_tips [2010-02-24 15:44] becki |
becki:linux:svn_tips [2015-11-04 14:32] (aktuell) becki |
||
---|---|---|---|
Zeile 2: | Zeile 2: | ||
===== Links == | ===== Links == | ||
- | - [[svnbook>1.5/|Svnbook]] | + | [[svnbook>1.5/|Svnbook]] - [[http://www.linux-magazin.de/heft_abo/ausgaben/2003/06/nachfolgemodell|SVN Intro]] (german) - [[CVS Tips]] - [[Mercurial Tips]] |
- | - | + | |
- | - [[http://www.linux-magazin.de/heft_abo/ausgaben/2003/06/nachfolgemodell|SVN Intro]] (german) | + | |
- | - [[CVS Tips]] | + | |
- | - [[Mercurial Tips]] | + | |
===== Apache Server Configuration == | ===== Apache Server Configuration == | ||
- | * Add the following to /etc/httpd/httpd.conf and restart Apache:<code> | + | * Uncomment or add the following to /etc/httpd/httpd.conf and restart Apache:<code> |
+ | LoadModule auth_digest_module lib/httpd/modules/mod_auth_digest.so | ||
+ | LoadModule dav_module lib/httpd/modules/mod_dav.so | ||
LoadModule dav_svn_module lib/httpd/modules/mod_dav_svn.so | LoadModule dav_svn_module lib/httpd/modules/mod_dav_svn.so | ||
LoadModule authz_svn_module lib/httpd/modules/mod_authz_svn.so | LoadModule authz_svn_module lib/httpd/modules/mod_authz_svn.so | ||
Zeile 26: | Zeile 24: | ||
</code> | </code> | ||
* Create the directiory ''/home/svn'' | * Create the directiory ''/home/svn'' | ||
- | * Add one or more users with [[install_config_tips#protect_a_directory_with_digest_authentication|htdigest]] | + | * Add one or more users with [[apache_httpd#protect_a_directory_with_digest_authentication|htdigest]] |
* Type ''svnadmin create /home/svn/test'' to create a repository called ''test'' | * Type ''svnadmin create /home/svn/test'' to create a repository called ''test'' | ||
* Type ''chown -R apache:apache /home/svn/*'' | * Type ''chown -R apache:apache /home/svn/*'' | ||
Zeile 32: | Zeile 30: | ||
===== svnserve Server Configuration == | ===== svnserve Server Configuration == | ||
+ | |||
+ | <note>This is not necessary if Apache Server (see above) is used!</note> | ||
+ | |||
==== Required == | ==== Required == | ||
Zeile 93: | Zeile 94: | ||
Add user ''nobody'' (Apache) to group ''svn'' in ''/etc/group'' to give Apache read permission for the svn repository. Then restart Apache and point your browser to http://server-hostname/cgi-bin/viewvc.cgi/. | Add user ''nobody'' (Apache) to group ''svn'' in ''/etc/group'' to give Apache read permission for the svn repository. Then restart Apache and point your browser to http://server-hostname/cgi-bin/viewvc.cgi/. | ||
+ | |||
+ | ===== Other Administration == | ||
+ | ==== Rename a Repostitory == | ||
+ | |||
+ | Just use normal ''mv'' as root. [[http://svnbook.red-bean.com/en/1.7/svn.reposadmin.maint.moving-and-removing.html|See also]] | ||
+ | |||
+ | ==== Locks == | ||
+ | |||
+ | View and remove locks: | ||
+ | svnadmin lslocks /local/path/to/repo | ||
+ | svnadmin rmlocks /local/path/to/repo | ||
+ | |||
+ | Clients can remove own and other locks as well. See below! | ||
+ | |||
+ | [[svnbook>1.7/svn.ref.html|more]] | ||
===== Client Configuration == | ===== Client Configuration == | ||
Zeile 116: | Zeile 132: | ||
The import command imports the ''testproj'' project to the root dir of the repostitory also as project ''testproj'' | The import command imports the ''testproj'' project to the root dir of the repostitory also as project ''testproj'' | ||
+ | |||
becki@client:~/test$ svn import testproj http://<servername>/<svnrootdir>/<reponame>/testproj | becki@client:~/test$ svn import testproj http://<servername>/<svnrootdir>/<reponame>/testproj | ||
Zeile 180: | Zeile 197: | ||
svn cp http://url/project/trunk http://url/project/branches/foo -m "Creating a branch for working on feature foo" | svn cp http://url/project/trunk http://url/project/branches/foo -m "Creating a branch for working on feature foo" | ||
svn checkout http://url/project/branches/foo | svn checkout http://url/project/branches/foo | ||
+ | |||
+ | project | ||
+ | |-- branches | ||
+ | | `-- foo | ||
+ | |-- tags | ||
+ | `-- trunk | ||
+ | |||
=== Use Cases == | === Use Cases == | ||
Zeile 190: | Zeile 214: | ||
=== Intro == | === Intro == | ||
- | <note tip>[[svnbook>1.5/svn.ref.svn.c.merge.html|Merging]] [[svnbook>1.4/svn.branchmerge.copychanges.html#svn.branchmerge.copychanges.keyconcept|means]]: Apply the changes between repository tree (= revision or branch) X and repository tree Y into the working directory</note> | + | <note tip>Merging ([[svnbook>1.5/svn.branchmerge.advanced.html#svn.branchmerge.advanced.advancedsyntax|explanation]] / [[svnbook>1.5/svn.ref.svn.c.merge.html|manpage]]): Apply the changes between repository tree X and repository tree Y into the working directory. Any revision on any branch is a repository tree.</note> |
* FIXME Verify: Merging is not symmetrical, i.e. if a line was added to a file between rev X and rev Y, than ''merge X Y'' will add that line to the file in the working dir and ''merge Y X'' will //remove// that line! | * FIXME Verify: Merging is not symmetrical, i.e. if a line was added to a file between rev X and rev Y, than ''merge X Y'' will add that line to the file in the working dir and ''merge Y X'' will //remove// that line! | ||
Zeile 196: | Zeile 220: | ||
* Merging does not always need to cover the whole project, it can be restricted to subdirs or single files. See also [[svnbook>1.5/svn.branchmerge.basicmerging.html]] -> selectively “copy” changes | * Merging does not always need to cover the whole project, it can be restricted to subdirs or single files. See also [[svnbook>1.5/svn.branchmerge.basicmerging.html]] -> selectively “copy” changes | ||
* Have a //clean// working directory before merging :!: | * Have a //clean// working directory before merging :!: | ||
+ | * It is also possible to specify only one repository tree source (e.g. the tunk) with the merge command. In this case, all modifications of the trunk since you first created your branch (which you work on) are applied to the working dir. Used e.g to [[svnbook>1.5/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.stayinsync|keep a branch in sync]]. | ||
+ | * For merging finishd branches which are to be discontinued and merged back into the trunk, the ''--reintegrate'' option is [[svnbook>1.5/svn.branchmerge.basicmerging.html#svn.branchemerge.basicmerging.stayinsync|necssary]] | ||
+ | * AFAIK it is not possible to easily keep two branches in sync (merge in both directions) like in [[mercurial_tips#merging|Mercurial]]. Basic merging in SVN is meant to frequently update branches from the trunk and finally reintegrate the branch into the trunk. To keep two branches in sync, advanced merging (with manual bookkeeping about what has already been merged) is necessary. | ||
=== Use Cases == | === Use Cases == | ||
Zeile 203: | Zeile 230: | ||
* FIXME Merge common parts of client-specific branches | * FIXME Merge common parts of client-specific branches | ||
* Undo committed Changes, see below | * Undo committed Changes, see below | ||
+ | |||
==== Undoing Changes == | ==== Undoing Changes == | ||
Zeile 216: | Zeile 244: | ||
See also [[svnbook>1.4/svn.branchmerge.commonuses.html]] -> Undoing Changes | See also [[svnbook>1.4/svn.branchmerge.commonuses.html]] -> Undoing Changes | ||
+ | |||
+ | === Commit Log Message Correction == | ||
+ | |||
+ | Example: | ||
+ | svnadmin setlog /path/to/repository --bypass-hooks logmessage.txt -r 25120 | ||
+ | |||
+ | See also: [[svnbook>1.5/svn.reposadmin.maint.html#svn.reposadmin.maint.setlog|Svnbook]] | ||
+ | |||
+ | ==== Locks == | ||
+ | |||
+ | View locks: | ||
+ | svn st -u | ||
+ | |||
+ | * O: Lock from someone else | ||
+ | * K: Own lock | ||
+ | |||
+ | Create and remove locks: | ||
+ | svn lock file | ||
+ | svn unlock file | ||
+ | |||
+ | [[svnbook>1.7/svn.advanced.locking.html|more]] -> from "Discovering Locks" on | ||
+ | |||
+ | |||
+ | |||