FETCH_HEAD reference not updating correctly after “git fetch”

前端 未结 3 1047
予麋鹿
予麋鹿 2021-02-08 22:19

I have a local repository that pulls from a remote one. Running git pull as well as git fetch; git merge FETCH_HEAD used to perform exactly the same ac

3条回答
  •  我寻月下人不归
    2021-02-08 23:05

    After you run git fetch (without arguments), FETCH_HEAD will only include a reference valid for merging (i.e. not marked as not-for-merge) if the current local branch (i.e. HEAD) is a tracking branch.

    The solution is to either make the current branch a tracking branch (see How do you make an existing Git branch track a remote branch?) or specify a remote and a branch to fetch (i.e. git fetch origin branch

提交回复
热议问题