I am trying to use the
Fixup feature on Magit. I will list a recipe to what it is happening:
(i) - I have a project under version control.
(ii) - My first commit is:
1f61d09 * first commit: add file
The content is:
1 file changed, 1 insertion(+) random-stack-overflow-questions/fixup-magit-test.txt | 1 + new file random-stack-overflow-questions/fixup-magit-test.txt @@ -0,0 +1 @@ +just a test
(iii) - My second commit is:
a503541 * second commit: changing the original file.
And the diff shows:
modified random-stack-overflow-questions/fixup-magit-test.txt @@ -1 +1,3 @@ just a test + +just another test
(iv) - Then, I decided to change the content of my first commit. I could do a new commit, then an interactive rebase, and use it to change the order of the commits moving the third/last commit to be before the second and squashed with the first.
Instead, I decided to use the feature Fixup - since it seems to be designed for situations like this.
Hence, I did the following change:
modified random-stack-overflow-questions/fixup-magit-test.txt @@ -1,3 +1,3 @@ -just a test +just a test FIXED-UP
After writing that change on the file, I staged the change, then I pressed
c to commit and, finally, I pressed lower case
f (not upper case
Things do seem to work. Unfortunately, when I pressed
git log, this is what I see:
5f91266 * main fixup! first commit: add file
I was not expecting the fixup! to be on
git log history. I thought my change would be a fix up on the first commit.
Did I miss something? How can I properly use the fix-up feature?
And what can I do now to achieve what I want? Is it necessary to do an interactive rebase to remove
fixup from the git log history?