I understand that Git can be used without a central repository. However, I am starting a project with several other people, and we are geographically distributed. I.e. We will never be on the same LAN to synch repos.
So my question: Is it possible to push / pull changes from each others repos over the internet? If so, how do I go about it? Easiest non-fuss way.
Thanx in advance.
When working off line, two Git tasks cannot be performed: fetching/pulling updates from the server, and pushing changes to the server. All other commands still work. One can commit changes, branch off, revert and reset changes, the same as when there exists an internet connection.
By default, git push only updates the corresponding branch on the remote. So, if you are checked out to the main branch when you execute git push , then only the main branch will be updated. It's always a good idea to use git status to see what branch you are on before pushing to the remote.
The objective is to push to multiple Git remotes with a single git push command. If you don't want to create an extra remote named all , you can skip the first command and use the remote origin instead of all in the subsequent command(s). Now, you can push to all remote repositories with a single command!
No, git push only pushes commits from current local branch to remote branch that you specified in command.
If you have SSH access to each others' machines (which may be a little easier to set up on some networks than git:// protocol access) then it's as easy as:
git pull ssh://username@host:/path/to/repository/.git
If direct access by any protocol isn't possible (e.g. if you're behind a router with NAT) then you can always send each other patches.
But Git has another way of doing this, git-bundle
, which lets you send a file (via email, or however else you send files) to your collaborators which can be pushed and pulled to and from like a repository. The author of Pro Git has a blog post tutorial on this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With