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
user392887's answer is mostly correct, but:
You should prefer to use SSH. According to GitHub, "We strongly recommend using an SSH connection when interacting with GitHub. SSH keys are a way to identify trusted computers, without involving passwords."
Anyone using RHEL/CentOS 6 will be using git 1.7.1 by default, which supports set-url.
So, the preferred solution for git 1.7.1. and later is:
git remote set-url --push origin git@github.com:username/somerepo.git