Suppose i have three files - file 1,file 2 and file 3. I add them, commit and push it. It goes to the gerrit system,and suppose i find that i had to change something in the file 1 I abandon the patch in gerrit. In my local system I edit the file 1 and do git status then it will only show file 1 as modified.
My problem here is to push the modified file(file 1 in this case), file 2 and file 3 in a single patch and push it.
If I do git pull it will say already up to date.
I tried git reset <previous commit id> then add my changes and push it. which would work fine but I don't know if its the right method.
Can anyone help??
Why did you abandon the change?
Gerrit was specifically designed for this purpose that you review your changes, see that file 1 needs to be changed, then you modify your file 1 and submit this again as patch 2
It is correct that the git status shows that only file 1 has changed. It compares to you local repository, not to gerrit.
The right way to do this is to make sure you have the commit-msg hook for gerrit in your local git repository hooks folder. This will add a Change-Id to your commit messages. With this gerrit can track which commits are related to the same change.
git commit -agit push origin HEAD:refs/for/mastergit commit -a --amendgit push origin HEAD:refs/for/masterNow your modification will show up as patch 2 and you repeat steps 3-5 until you are satisfied.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With