Git merge without changing anythingΒΆ

When there are two [[git]] branches that should be merged but one of them is already in a perfect state that needs no changes a fake merge can be conducted without accepting any changes from the other branch. The solution is described in this discussion.

checkout the branch that is already perfect.

git merge branch-to-merge

If any merge conflicts ignore them and commit

git add every thing
git commit

Get the recent commit hash of the merge

git log

Reset the HEAD to bring the working directory in the perfect state before the merge

git reset HEAD~ --hard

Go back to the merge commit without changing the working directory

git reset 12345abc --soft

Overwrite the merge commit without changing the commit message to the current state of the working directory

git commit --amend --no-edit