Git interactive rebase
2019-11-25 本文已影响0人
JaedenKil
Say I created a branch '' to fix a bug, for debugging, multiple commits have been created:
003e30d (HEAD -> dev_updateAdbRestore, origin/master, origin/HEAD, master) Add more log
de9df07 Add more log
71b04a7 Update log
a58d4de Add more log
67c81b9 (origin/dev_updateAdbRestore) Update ui clicking method
f465b98 Update click ui command log
592757a Update click android ui method
2f3a778 Update click 'restore' method
1b0bbe7 Update the click 'restore' method
32aa6a5 Update the method to click btn 'restore'
24bb836 (upstream/master) Add rsync support
I want to keep 24bb836
, and squash all other commits into one:
git rebase --interactive 24bb836
In the next UI:
- Replace all 'pick' to 'f' EXCEPT for the top one.
- Amend the top commit's message
- Save and exit
Then, check the status by git log --oneline
, perhaps a git push -f
is needed.