Accidentally did a branch origin set up to track local branch
I accidentally did:
git checkout mybranch git branch --set-upstream origin mybranch
Branch origin set up to track local branch mybranch.
How do I reset that and what could it do to me?
2 Solutions collect form web for “Accidentally did a branch origin set up to track local branch”
If all else fails, just edit
.git/config with text editor. All the command does is set there
[branch "origin"] merge=refs/heads/mybranch
so just remove the invalid setting.
That means you just have a local branch that is set to be tracking the remote branch with the same name. No harm in having that, you are not forced to use the remote branch;)
You can remove the tracking link with
or delete the remote branch:
git push origin :branch-name
For the latter, if you want to, you need to specifically remove the branch with the -d option.