How to resolve git's “not something we can merge” error

前端 未结 25 1254
隐瞒了意图╮
隐瞒了意图╮ 2020-12-04 05:42

I just encountered a problem when merging a branch into master in git. First, I got the branch name by running git ls-remote. Let\'s call that branch \"branch-n

25条回答
  •  执笔经年
    2020-12-04 06:44

    When pulling from a remote upstream, git fetch --all did the trick for me:

    git remote add upstream [url to the original repo]
    git checkout [branch to be updated]
    git fetch --all
    git merge upstream/[branch to be updated]
    

    In other cases, I found the "Not something we can merge" error will also happen if the remote (origin, upstream) branch does not exist. This might seem obvious, but you might find yourself doing git merge origin/develop on a repo that only has master.

提交回复
热议问题