I would like to do a git merge to plough the work of one branch back into another.
However, since a lot has been done and I’m going to do a no-fast-forward merge I would like the commit to contain extensive information about what’s in the merge.
If I were doing a normal commit I could use the -m flag and an editor would be fired up for me to put the details into (edit this is incorrect – see below). However if I use the -m flag during commit it simply tells me that the message requires content:
$ git merge development --no-ff -m
error: switch `m' requires a value
Since I have a fairly large merge message, I would prefer an editor rather than a single line string. How can I get that though?
EDIT
Although the answers have covered my question I realised that using the -m flag during a normal commit does not in fact fire up the editor (although -a does if you’re creating a tag). The only way I’ve to get the editor during a normal commit it to simply type commit with no other flags or options.
Use the
--no-commitflag, and then typegit commit– you’ll be able to edit the message then:Alternatively, if you’ve already done the merge, you can amend the merge commit to change its message with: