Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have just been access to a server that someone said is "the git repository"

I have not used git before, but I assume that must mean there are a set of files somewhere that are the "gold copies" that other developers are pulling from when they do their git updates. How do I find what those directories are? How can I determine what the "access url" that folks who wnat to checkout can use?


share|improve this question
I would read a tutorial. Here a list of 10 good tutorials. If you're used to a VCS like SVN, forget everything you know, git is completely different. –  criziot Jul 9 '12 at 21:31
ok thanks for the comments. I will close this out and repost when I have a more specific issue –  Derek Jul 9 '12 at 21:55
add comment

1 Answer

up vote 2 down vote accepted

Note that Git, as well as other DVCSes, use slightly different concepts than centralized SVN or CVS systems. In particular, the normal usage is not to "check out" but to clone a repository, downloading its complete history instead of just the head – in other words, the fact that your server has "gold copies" is only political, and any clone can be used as a "gold copy" easily. This is not very important right now, but worth remembering nevertheless, in particular when you forget to do backups...

Find out what software was used to set up the server – was it Gitolite, Gitosis, or just a custom ssh + git-daemon setup?

Gitolite and Gitosis use a central configuration file and keep everything in the home directory of an account named git. Run cd ~git, look for repositories there. The URLs will likely be git://<server>/<repository>.git for public access and git@<server>:<repository>.git for pushing over SSH. Both Gitosis and Gitolite have separate management tools – try the gitolite command.

If no such account exists in system, or if it does not contain the "admin" repository, check if anything is listening on port 9418, the Git smart protocol port; if it's git-daemon, check its command line with ps www <pid>. The public URLs will still start with git://<server>/, but the rest depends on git-daemon's command-line options; it may or may not require the full filesystem path, it may or may not support "vhosts"; it may or may not have ~username/path/repo.git style userdirs enabled. The SSH addresses might be <username>@<server>:</path/to/repo>.git; note that SSH always works even without git-daemon.

The server might also have a web interface set up (cgit or gitweb), which should list all configured repositories. Try accessing it over a web browser. Look in /etc for configuration of gitweb / cgit.

A useful command is git ls-remote <url>, which can show a quick summary of a repository without cloning it. This way you can check if URLs are valid.

share|improve this answer
add comment

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.