What SVN command can I use to see the branch I'm currently using?

Svn

Svn Problem Overview


I generally use Subclipse, but there's some wonkiness in my code right now and I want to do some sanity checks from the command line. Thanks to Subclipse, I can usually see the branches I'm using in Eclipse's Package Explorer window.

screenshot of branch information in Eclipse

What command can I use from the command line to see the branch I'm currently using?

Resources I tried before Stack Overflow include the SVN book, this list of commands and this other list of commands. I didn't find anything that would let me passively look at branch information (as opposed to making some sort of active branch modification, which is not what I want).

Svn Solutions


Solution 1 - Svn

Try the following:

svn info

This will give you the URL your workspace is a checkout of, relative to where you are in the workspace. You should be able to see the branch in the URL.

Solution 2 - Svn

With some regex, you can get just the branch name:

svn info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$'

Solution 3 - Svn

'svn info' from https://edoras.sdsu.edu/doc/svn-book-html-chunk/svn.ref.svn.c.info.html

The branch is what shows up in the URL below:

$ svn info foo.c
Path: foo.c
Name: foo.c
URL: http://svn.red-bean.com/repos/test/foo.c
Repository Root: http://svn.red-bean.com/repos/test
Repository UUID: 5e7d134a-54fb-0310-bd04-b611643e5c25
Revision: 4417
Node Kind: file
Schedule: normal
Last Changed Author: sally
Last Changed Rev: 20
Last Changed Date: 2003-01-13 16:43:13 -0600 (Mon, 13 Jan 2003)
Text Last Updated: 2003-01-16 21:18:16 -0600 (Thu, 16 Jan 2003)
Properties Last Updated: 2003-01-13 21:50:19 -0600 (Mon, 13 Jan 2003)
Checksum: d6aeb60b0662ccceb6bce4bac344cb66

Solution 4 - Svn

svn info will tell you the origin of your working copy. From that you can tell the branch.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPopsView Question on Stackoverflow
Solution 1 - SvnJoshua McKinnonView Answer on Stackoverflow
Solution 2 - SvnoaklandrichieView Answer on Stackoverflow
Solution 3 - SvnmooredsView Answer on Stackoverflow
Solution 4 - SvnJayMView Answer on Stackoverflow