Git pass commit message and nothing more?

When processing download requests on GitHub, often I want to merge commits with a branch without changes. However, I would like to do something right after the merger. I don't want git commit --amend because it will change the commit I bring, so tracking changes becomes more complicated.

Is there a way for git commit do nothing but post? The reason is because I might want to mention something in the Pull request - a URL pointing to a test case, or specify another pull request so that I can use a commit commit, like Closes #123 , in addition to the original request on pull

+6
source share
2 answers

To do an empty commit, use git commit --allow-empty .

+9
source

You can use git merge --no-commit branch to merge, but not autosave. Now you can configure the actual commit as if the merge failed, including changing the commit message.

Alternatively, you can enter the message git merge -m "message" branch , which is added to the merge commit.

+3
source

Source: https://habr.com/ru/post/925664/


All Articles