I'm in a scenario where we're taking a long time to migrate from repo server to another.
As such, I have one remote in my .git/config that reads
[remote "upstream"]
url = ssh://my.old.url/here
fetch = +refs/heads/*:refs/remotes/upstream/*
...
[remote "origin"]
url = git@my.new.url/here
fetch = +refs/heads/*:refs/remotes/origin/*
However, whenever I do git status
or git push
or git pull
git checkout
it defaults to upstream and not origin. How do I get it to default to origin for git commands?
Clarification: I"m not asking on a per branch basis, but on a project basis, so that all commands default to origin unless otherwise stated.
(Updating by git commands rather than editing the config file is preferred.)