Still trying to learn how to use Gerrit and its process. Steps I did where
change1
to gerrit for review to HEAD:refs/for/develop
The situation is exactly like @Trevor explained. rebase -i
is a good way to do when you have this condition.
Personally, I use this command as well but with a little bit different:
1. Use --fixup and --autosquash
you have two commits:
old commit
new commit
when you want to change old commit, then
git commit --fixup
then rebase with autosquash,
git rebase -i --autosquash
If it's unclear of my comments, you can check the detail in: https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html
OR
2. Take advantage of Gerrit
After you commit two changes, you will have two open-reviews change on you GUI.
Then go to your "old change", select download -> checkout this change, actually after you checkout, you will go to a branch for this change, then fix your code, amend, rebase, push ... like what you do as usual.