'Get all commits into a single commit after merge in git

enter image description here

As you can see in the image above, there is a branch 'fnf1' with sha - '40b1...' In this commit some code changes were made in file 'A'. This branch has already been merged with main branch. Now, I want to make some new changes in the code file 'A'.

My main goal is to keep all the changes made in code file 'A' in a single commit. However, when I make new changes and rebase on the main, the new commit only contains the current change but not the changes made in '40b1...' commit.

What shall I do to get the changes of commit '40b1...' and and new change that I want to make into a single commit?

git


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source