Is there an option like --author of git-commit for git-merge?
We maintain a staging environment where some changes must be performed. Some limitations make us to use only one linux user to access staging environment.
Anyway, we are a small team with cooperative initiative and we tell when doing commits, which one is the author using the --author git-commit option. However, some times we need to merge from other branches which result in a non-ff merge. This implies a commit is performed when doing this merge.
Which would be the best way to specify the author manually for the merge commit in this case?
Usually git does not overwrite anything during merge.
Updated answer for 2020:You can then edit the merge commit as desired via git commit --amend . Find the merge commit you want to edit in the todo list. Insert a new line after the merge commit that contains only break (or b ). Use git commit --amend to edit the merge commit as desired.
First, prevent the merge from creating the commit:
git merge --no-commit …
Then, do the commit manually:
git commit --author="A. U. Thor <[email protected]>"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With