Is there a way to set up a git repository, so that git pull defaults to one remote and git push defaults to another? I know I can set both by changing the value of the remote variable in branch section of .git/config, but how to do it for each direction separately?
Is there a way to set up a git repository, so that git pull
Share
For Git 1.6.4 and later, set
remote.<name>.pushurlwith git config.One might use this to pull using the read-only
https:protocol and push using an ssh-based protocol.Say
origin‘s url (remote.origin.url) ishttps://git.example.com/some/repo.git. It is read-only, but you have write access through the ssh-based ‘URL’git@git.example.com:some/repo.git. Run the following command to effect pushing over the ssh-based protocol: