155

I have an svn working copy on my local system. I want to get the remote repository URL. Is there some command for doing this?

1
  • When you say 'workspace' do you mean you're using SVN integrated into some IDE e.g. Eclipse? Either way Grhm's command-line solution will work, provided you have the command-line tools installed too though. Commented Feb 3, 2012 at 16:25

8 Answers 8

221

Try:

svn info .

This should give some information about the current working copy, including the remote URL.

From the manual, an example output is:

$ 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  
Sign up to request clarification or add additional context in comments.

1 Comment

The accepted answer should integrated the answer from Sam Buchmiller: svn info --show-item=url --no-newline
22

As of Subversion 1.9 you can now request a specific item from svn info.

svn info --show-item=url

This will output only the remote url. To get rid of the newline at the end, add this extra option:

svn info --show-item=url --no-newline

Comments

19

Try this:

svn info | grep URL | sed  's/URL: //g'

3 Comments

You can also make that svn info | sed -ne 's/URL: //p' and save the grep; the -n and p mean only print matching lines
svn info | grep ^URL | tail -c+6 =)
This command also gives me the relative URL, so I had to pipe it through head like this: svn info | grep URL | sed 's/URL: //g' | head -1 to get just the URL.
3

svn info | grep 'URL' | awk '{print $NF}'

where awk $NF prints only the last column in a record

Comments

1
svn info | grep ^URL: | sed  's/URL: //g'

Comments

1

If you have installed Tortoise SVN . Just Right click inside your SVN repo and look for "repo browser". Hope it helps

Comments

1

Adding to other answers. When you want to get the repository URL of your working copy, you can run the following PowerShell snippet:

([xml](svn info --xml)).info.entry.URL

Comments

0

I found it, open entries file in the .svn folder in notepad, it will show the url in the beginning.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.