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

前端 未结 25 1335
隐瞒了意图╮
隐瞒了意图╮ 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:27

    If the string containing the reference is produced by another Git command (or any other shell command for that matter), make sure that it doesn't contain a return carriage at the end. You will have to strip it before passing the string to "git merge".

    Note that it's pretty obvious when this happens, because the error message in on 2 lines:

    merge: 26d8e04b29925ea5b59cb50501ab5a14dd35f0f9
     - not something we can merge
    

提交回复
热议问题