I'd like to know whether a remote repository exists. Here's what I came up with:

git ls-remote "$REPO_URL" &> /dev/null

Is there any better way?

link|improve this question
4  
It seems like a fine choice. The overhead of the “extra work” of fetching and formatting the list of refs (which is then sent to /dev/null) should be fairly small. – Chris Johnsen Dec 31 '10 at 0:57
feedback

1 Answer

up vote 5 down vote accepted

I think the git ls-remote command is pretty much made for that purpose.

link|improve this answer
Thanks Chris, thanks Peter! – Jo Liss Jan 2 '11 at 17:43
feedback

Your Answer

 
or
required, but never shown

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