Changing the Git remote 'push to' default Changing the Git remote 'push to' default git git

Changing the Git remote 'push to' default


You can use git push -u <remote_name> <local_branch_name> to set the default upstream. See the documentation for git push for more details.


To change which upstream remote is "wired" to your branch, use the git branch command with the upstream configuration flag.

Ensure the remote exists first:

git remote -vv

Set the preferred remote for the current (checked out) branch:

git branch --set-upstream-to <remote-name>

Validate the branch is setup with the correct upstream remote:

git branch -vv


Working with Git 2.3.2 ...

git branch --set-upstream-to myfork/master

Now status, push and pull are pointed to myfork remote