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
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