Is it possible to pull from one repo and push to other one?

Solution 1:

Set a push URL for the remote that is different from the pull URL:

git remote set-url --push origin [email protected]:repo.git

This changes the remote.name.pushurl configuration setting. Then git pull will pull from the original clone URL but git push will push to the other.


In old Git versions, git remote set-url did not have the --push switch. Without it, you have to do this by changing the configuration setting manually:

git config remote.origin.pushurl [email protected]:repo.git

Solution 2:

git pull private master and git push github master pulls from your private repo (given it's named like that) and pushes to github (might also be called origin). It's not SVN ;-)