modularml / stack-pr

A tool for working with stacked PRs on github.
Other
291 stars 10 forks source link

Question: Amending previous commits #34

Closed vck3000 closed 3 weeks ago

vck3000 commented 1 month ago

Hi there,

Nice project!

If we need to make changes to any of the PRs (e.g. to address the review feedback), we simply amend the desired changes to the appropriate git commits and run submit again. If needed, we can rearrange commits or add new ones.

Simple question, but could you provide some examples on how you would amend a previous commit, and how you would rearrange commits/add new ones?

In my current workflow, for a particular PR, I would simply push new commits, so I'm not sure the best way to amend something in the past.

Thanks!

AmaranthineCodices commented 1 month ago

Generally you accomplish this by rebasing. An interactive rebase will allow you to edit a given commit or re-order commits arbitrarily (as long as the resulting merge conflicts are resolved). It will also allow insertion of new commits at any point in the stack. Once the rebase is performed, stack-pr submit will update any existing PRs on GitHub, as well as create new ones, to reflect the changes made to your local branch.

ZolotukhinM commented 3 weeks ago

@AmaranthineCodices's answer is on point, and I'm going to close this issue. Please feel free to file more issues with questions/bugs/feature requests!

vck3000 commented 3 weeks ago

Great, thank you. I will have a read!