Can Git push / pull over the Internet to distributed repositories?

I understand that Git can be used without a central repository. However, I start the project with several other people, and we are geographically distributed. That is, we will never synchronize repositories on the same local network.

So my question is: is it possible to push / pull changes between each other's repositories via the Internet? If so, how do I do this? The easiest way without fuss.

Thanx in advance.

+6
git
source share
4 answers

If you have access to SSH for each other's machines (which may be a little easier to configure on some networks than git: // protocol access), then this will be simple:

git pull ssh:// username@host :/path/to/repository/.git 

If direct access via any protocol is not possible (for example, if you are behind a router with NAT), you can always send patches to each other.

But Git has another way of doing this, git-bundle , which allows you to send a file (via email or, nevertheless, you send files) to your employees, which can be clicked and pulled into and out of, like a repository. Pro Git has blogging tutorial at this .

+12
source share

If you can use ssh for each other's computers, you can make git push / pull on each other's computers. However, it is actually not recommended to have a fully peer-to-peer repository. One of you should maintain a bare repository that everyone syncs with, otherwise you will encounter strange and annoying situations when you click on the repository that someone else is working on .

In fact, it is probably best to use github if you are not working on something closed source and cannot afford to pay for private repositories.

+5
source share

You need some kind of β€œdirect” non-nat-ed connection (this means that if you are behind a router, this is a problem). If I were you, I would go on github

The help section explains everything perfectly.

+3
source share

I would suggest using a central repository location that you can all click and pull using ssh. This will prevent the problem mentioned above caused by clicking on the repo in which someone is working.

See this link for a good setup:

http://toolmantim.com/thoughts/setting_up_a_new_remote_git_repository

+2
source share

All Articles