How to change a local branch tracking to Different remote in Git
In this tutorial, we will learn how to change a local branch tracking to a different remote in git.
Change tracking
We can change a local branch tracking to a new remote by using the git push
command followed by -u
flag and origin your-branch-name
.
Example:
git push -u origin dev
dev is my local branch name.
The -u
flag sets the upstream (tracking) reference to a remote branch.