📦 ghstack/ ezyang
Submit stacked diffs to GitHub on the command line
Установка и запуск
How to use
Make sure you have write permission to the repo you're opening PR with.
Prepare a series of commits on top of main, then run ghstack. This
tool will push and create pull requests for each commit on the stack.
How do I stack another PR on top of an existing one? Assuming
you've checked out the latest commit from the existing PR, just
git commit a new commit on top, and then run ghstack.
How do I modify a PR? Just edit the commit in question, and then
run ghstack again. If the commit is at the top of your stack,
you can edit it with git commit --amend; otherwise, you'll have
to use git rebase -i to edit the commit directly.
How do I rebase? The obvious way: git rebase origin/main.
Don't do a git merge; ghstack will throw a hissy fit if you
do that. (There's also a more fundamental reason why this
won't work: since each commit is a separate PR, you have to
resolve conflicts in each PR, not just for the entire stack.)
What if the repository default branch changed? ghstack caches
repository metadata in .git/ghstack-repo-info.json for the local
checkout. If ghstack is still using an old default branch name,
delete that file and rerun ghstack; it will query GitHub again.
How do I start a new feature? Just checkout main on a new branch, and start working on a fresh branch.
How do I merge my changes? Warning: You will NOT be able to merge these
commits using the normal GitHub UI, as their branch bases won't be main.
Use ghstack land $PR_URL (or alternatively ghstack land #PR_NUM) to land
a ghstack'ed pull request.
…
Из README репозитория · полный README на GitHub