Git merge & add change id

What is the correct way to add a change identifier to a merge transaction afterwards?

I merged some changes from the main branches that caused a merge that does not contain the change identifier. This is not the last commit, so commit -amend does not work.

I tried using interactive redirects, but cannot find a comment between other commits to rewrite the commit message.

How can i solve this? Is there a meter to avoid these situations?

Thanks,

Hubi

+4
source share
1 answer

you can use

git rebase -i --preserve-merges 

or

 git checkout -b temp SHA1-of-merge git commit --amend # this is where you change your message git rebase --onto temp SHA1-of-merge my-branch 

Just remember that after that you will need to force push your branch and may need to inform everyone who is working on the repo at the moment.

+1
source

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


All Articles