I have a script called \'git-export\' which helps me to export a remote repository. It is run like that:
git-export http://host.com/git-repo <-t tag or -b
You can use curl for checking if the specific url exists or not for example when i try to hit angularjs existing url
$ curl -I https://github.com/angular/angularjs.org/tree/master/src
**HTTP/1.1 200 OK**
Server: GitHub.com
Date: Mon, 11 Aug 2014 15:22:40 GMT
When I hit on a wrong URL
$ curl -I https://github.com/angular/angularjs.org/tree/master/abcd
**HTTP/1.1 404 Not Found**
Server: GitHub.com
Date: Mon, 11 Aug 2014 15:24:06 GMT
Hope this helps