Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

svn

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).

like image 915
Pops Avatar asked Mar 11 '11 17:03

Pops


People also ask

How can I see svn branches?

and tags, and then just "ls". You can run "svn list -h" for more info on list.


2 Answers

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.

like image 131
Joshua McKinnon Avatar answered Sep 22 '22 07:09

Joshua McKinnon


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

svn info | grep '^URL:' | egrep -o '(tags|branches)/[^/]+|trunk' | egrep -o '[^/]+$'
like image 26
oaklandrichie Avatar answered Sep 26 '22 07:09

oaklandrichie