You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got stuck on this for a bit so I figure this might be useful to someone.
Git will not automatically update your local repository's default branch if the remote's default branch changes. So, if you change your default branch from master to develop, any copies of the repo cloned prior to the change will think master is the default branch, while any copies after the change will think develop is the default branch. This can cause the script to offer differing results depending on the machine you're on.
Solution: git remote set-head origin -a will update the branch that git considers the origin/HEAD to match the current default branch in the origin remote.
I got stuck on this for a bit so I figure this might be useful to someone.
Git will not automatically update your local repository's default branch if the remote's default branch changes. So, if you change your default branch from
master
todevelop
, any copies of the repo cloned prior to the change will thinkmaster
is the default branch, while any copies after the change will thinkdevelop
is the default branch. This can cause the script to offer differing results depending on the machine you're on.Solution:
git remote set-head origin -a
will update the branch that git considers theorigin/HEAD
to match the current default branch in theorigin
remote.Source: Stack Overflow
The text was updated successfully, but these errors were encountered: