I have 2 remove repositories (origin1
and origin2
for example).
And origin1
is my default remote repo.
How can I change my default remote repo, so when i do git push
commits push to origin2
.
I have 2 remove repositories (origin1
and origin2
for example).
And origin1
is my default remote repo.
How can I change my default remote repo, so when i do git push
commits push to origin2
.
You can change the remote repository your local branch is currently tracking
git branch local_branch_name --set-upstream-to origin2/remote_branch_name
or
git branch local_branch_name -u origin2/remote_branch_name
After this, your pull
and push
will be done on the new tracked remote.
Have you tried "git remote add" command? https://docs.github.com/en/free-pro-team@latest/github/using-git/adding-a-remote