Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Show svn log for a particular folder

Answer:

To show the svn log for a particular folder, just need to use..

# svn log /data/foo

------------------------------------------------------------------------
r1935 | john@example.com | 2011-11-23 19:05:43 +0800 (Wed, 23 Nov 2011) | 1 line

Fixed the crash issue (Jira 2001)
------------------------------------------------------------------------
r1934 | john@example.com | 2011-11-23 18:47:54 +0800 (Wed, 23 Nov 2011) | 1 line

Added missed files

How to merge a branch back into trunk using SVN

Answer:

To merge a branch back into the trunk using SVN: (Assume your local corresponding folders are branch and trunk)

1. Get the revision number at which the branch was created

# cd branch
# svn log --stop-on-copy

2. Get the head revision number of your trunk

# cd trunk
# svn update

3. Merge in action

# cd trunk
# svn merge -r <BRANCH_CREATION_REVISION_NUMBER>:<HEAD_REVISION_NUMBER>
               http://example.com/svn/repos/demo/branches/<MY_BRANCH> .

Revert all local changes in SVN

Answer:

Too revert all local changes in your current SVN repository, you can run the following command

# svn st -q | awk '{print $2;}' | xargs svn revert

That is it.

Move a directory in a subversion repository

Answer:

To move a directory in a subversion repository, the method we used is very similar to rename a directory under an UNIX shell.

# svn move -m "Move a directory" http://example.com/svn/repos/demo/trunk/foo http://example.com/svn/repos/demo/trunk/bar

List files under a directory in SVN repository

Answer:

To list all the files or sub-directories inside a given SVN repository's directory, you can try:

# svn ls http://example.com/svn/repos/demo/trunk