In the magit-status window Magit shows '^M" for many things. This is on FreeBSD, which should be using newlines instead:Shot of magit-status

This is, I think, the reason the push doesn't work right. From the magit-process buffer:

git … push -v origin master^M:refs/heads/master

  • What is the question?
    – Drew
    Commented Dec 24, 2015 at 21:03
  • Shot in the dark: does changing magit-process-connection-type to nil fix it?
    – npostavs
    Commented Dec 25, 2015 at 0:36
  • @Drew I think it's kind of obvious: Magit appends ^M where it shouldn't: how to change this (or is by design, a bug, a known bug)? PS. I'd look into ~/.gitconfig if there is one, or .gitattributes and the plethora of other Git configuration files where you may have accidentally specified (or forgot to specify) how Git needs to handle newlines. Unfortunately, there are just too many ways to do this and none easy to understand or find... But if this behavior is consistent between different repositories on your computer, then the chance is it's in some global config...
    – wvxvw
    Commented Dec 25, 2015 at 12:40
  • @wvxvw: It might be obvious to some readers, but it generally helps, and doesn't hurt, to pose question(s) explicitly. Even in your comment you raise more than one question: how to change this? Is it a (known) bug? Is it by design? (and implicitly, if so, why? what does it mean?) What is the cause? Is there a global config that affects this? Note that I didn't vote to close the question as unclear. My comment was a suggestion to improve the question by making it explicit.
    – Drew
    Commented Dec 25, 2015 at 18:34
  • FWIW, I've seen this on Windows when using tramp to connect to a remote directory on Linux. (I thought the ^M were Windows line breaks; but not in your case apparently.) Once it happens, the normal emacs Find-File mechanism breaks, due I think to an invalid default-directory. I haven't isolated Steps to Reproduce yet though.
    – InHarmsWay
    Commented Dec 25, 2015 at 19:27

1 Answer 1


That was fixed in v2.6.0, see the release announcement.

Edit: Hm, actually after looking at the screenshot a little more carefully, I think this might not actually be enough in your case. This is very strange and I am guessing that "something" is terribly misconfigured. (And it's not Magit. Magit does not "appends ^M where it shouldn't". Instead it does "not make any attempt to remove ^M, because there aren't supposed to be any in the first place".)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.