Rewriting Git History. How to delete an alert?

When overwriting the history of the Git repository, how do you delete statements (created with git commit -sor git commit --signoff)?

git filter-branch commit-filterapparently only supports the variables used git commit-tree:

GIT_AUTHOR_NAME
GIT_AUTHOR_EMAIL
GIT_AUTHOR_DATE
GIT_COMMITTER_NAME
GIT_COMMITTER_EMAIL
GIT_COMMITTER_DATE
EMAIL
+3
source share
2 answers

Statements are part of the message body. So, you want to use git filter-branch --msg-filterthe command to run to find lines starting with Signed-off-by:, and delete them.

Sort of

git filter-branch --msg-filter "sed /^Signed-off-by:/d"

gotta do the trick.

+10
source

To remove all signatures or all signatures by a specific person / email address, see Brian's answer.

, (.. ), , :

rebase (git rebase -i) , , pick reword. .

+1

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


All Articles