Closed giovannizotta closed 1 week ago
In vanilla git, I recommend using git rebase -i
. So git rebase -i $(git merge-base origin/main HEAD)
, 'edit' the commit you want, git rebase --continue, ghstack.
If you want to checkout PR1, and then you want to update PR2, you have to cherry-pick PR2 on top of your amended PR1. And it has to be the orig comimt; if you lost it you should use origin/gh/giovannizotta/XX/orig as the cherry-pick.
Thank you for the quick reply @ezyang!
I'm a bit confused by the process. If I had to do this manually via vanilla git, I would:
git commit --amend
How does this process look like with ghstack
? If I have to cherry-pick PR2 on top of PR1 any time I make a change and fiddle with open PRs it sounds like more work than the vanilla git solution. Am I missing something?
Now I understand what you meant by git rebase -i
. I was missing the fact that you have to checkout the top-most PR in the stack, instead checking out the commit you want to edit. And from the interactive rebase, just edit the commit. Makes sense!
The important thing is ghstack modifies your commit messages after the first submit and you need to make sure you preserve the ghstack metadata!
I just started using
ghstack
.I have 2 PRs, one stacked on top of each other:
If I need to modify PR1, what is the expected process?
I imagined:
git commit --amend
ghstack
(probably a mistake)ghstack
However, this did not work as expected, and I am a bit confused by the many branches that have been created and I am not sure how to solve this situation. Some guidance on how this usually works is really appreciated!