Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2 svn checkouts that someone setup for me. Now I need to check these same files on another computer, but since I didn't check them out initially I don't know the urls to use when running the svn checkout command:


Since these 2 checkouts already exist on one of my servers, is there a way to get the url of the repo from which they were initially checked out from?

share|improve this question
up vote 79 down vote accepted

You can get the URL of the directory you are in, as well as the Repository Root and other info by running the following command in any of the checked out directories:

svn info

If you want a command to return only the URL for the repository, perhaps for use in a script, then use the command:

svn info | grep 'Repository Root' | awk '{print $NF}'
share|improve this answer
You're awesome dude! – Manny Sep 11 '11 at 22:51
Same thing for windows: svn info | findstr /C:"Repository Root: " – Sebastian Oct 11 '12 at 9:53
Thanks for your note, Sebastian. – Vladimir Blaskov Oct 11 '12 at 21:45

For SVN 1.7 I had to use

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

I hope this helps anyone else that comes here with a newer SVN

share|improve this answer
The accepted answer is still working for svn, version 1.7.9 (r1462340) compiled Apr 13 2013, 14:22:38. – dash17291 May 18 '13 at 21:14
@dash17291 it "works" as in it prints something out but not the right info. It returns the repo root which is not what the asker wants. The root is not the repo url (at least not usually). With the above answer you will get vs mine where you will get or whatever you have checked out. – JoshStrange May 20 '13 at 13:19
This also matches "Relative URL" using svn 1.8.10. The grep should be changed to grep "^URL" – Burhan Ali Aug 3 '15 at 11:29
Thanks Burhan, I've edited the above to fix it for 1.8 – JoshStrange Aug 3 '15 at 14:55

No need to grep, just use AWK for the search and delimiting the string
svn info | awk '/^URL/{print $2}'

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.