First, let's find out how many commits need to be merged. This command will show you what commits you have added compared to the develop branch:
[IMG:https://user-images.githubusercontent.com/1216225/95240409-0966ce80-0815-11eb-81fb-2b593bb86a54.png]
how many changes
[IMG:https://user-images.githubusercontent.com/1216225/95240492-2ac7ba80-0815-11eb-832d-e54c714af084.png]
I have 2 commits. Now I want to rewrite history from HEAD~2, that is, from what was 2 commits ago. To do this, I do this:
a text editor opens automatically.
[IMG:https://user-images.githubusercontent.com/1216225/95241214-20f28700-0816-11eb-8c5e-a29e562675e5.png]
Here's a list of my commits and a big comment on what I can do. From the list of commands, you can see that we can use squash or fixup in order to glue commits. The first comes in handy when you want to change the commit message, and the second when you want to use the commit message of the first. So, to glue all the commits, I do like this:
[IMG:https://user-images.githubusercontent.com/1216225/95241711-d32a4e80-0816-11eb-8718-5ceadaafe7b2.png]
It was
[IMG:https://user-images.githubusercontent.com/1216225/95242101-64012a00-0817-11eb-9f6b-a0a814a70d39.png]
and so it became
[IMG:https://user-images.githubusercontent.com/1216225/95242161-77ac9080-0817-11eb-92e0-ed9723262437.png]
bye all
-sch
[IMG:https://user-images.githubusercontent.com/1216225/95240409-0966ce80-0815-11eb-81fb-2b593bb86a54.png]
how many changes
[IMG:https://user-images.githubusercontent.com/1216225/95240492-2ac7ba80-0815-11eb-832d-e54c714af084.png]
I have 2 commits. Now I want to rewrite history from HEAD~2, that is, from what was 2 commits ago. To do this, I do this:
a text editor opens automatically.
[IMG:https://user-images.githubusercontent.com/1216225/95241214-20f28700-0816-11eb-8c5e-a29e562675e5.png]
Here's a list of my commits and a big comment on what I can do. From the list of commands, you can see that we can use squash or fixup in order to glue commits. The first comes in handy when you want to change the commit message, and the second when you want to use the commit message of the first. So, to glue all the commits, I do like this:
[IMG:https://user-images.githubusercontent.com/1216225/95241711-d32a4e80-0816-11eb-8718-5ceadaafe7b2.png]
It was
[IMG:https://user-images.githubusercontent.com/1216225/95242101-64012a00-0817-11eb-9f6b-a0a814a70d39.png]
and so it became
[IMG:https://user-images.githubusercontent.com/1216225/95242161-77ac9080-0817-11eb-92e0-ed9723262437.png]
sch wrote:
remember that deleted it cannot be restored
bye all
-sch
The post was edited 7 times, last by schnek ().