At our office, we started off with the simplest possible way of sharing Git repositories (well, apart from using Github): Bare repositories on a server with SSH access.
So, our first Git URL looked like this:
However, it quickly became obvious that the above URL schema has a shorthand format (if ~git = /var/git):
We can also leave out the .git suffix in the end, as Git will append this for us automatically.
Now, if we were to configure our ~/.ssh/config with an alias and a username for this SSH connection:
Host git HostName git.ourservers.com User git
Now we can use the alias host, and leave out the username. So now, when we want to clone a repository "foo", we just do:
git clone git:foo
The same principle can be used for any SSH/Git server, including Github.
Say I have the SSH URL from the Github web interface:
I add an ~/.ssh/config entry like this:
Host hub HostName github.com User git
Now I can do this locally:
git clone hub:tfnico/guava-examples
It even works on Windows with OpenSSH (or Github for Windows).