-
-
Notifications
You must be signed in to change notification settings - Fork 780
Splitting (Breaking down) Pull Requests
Sometimes maintainers will ask you to break your Pull Request (PR) into smaller ones. To do that, please follow the steps outlined below.
-
Do a soft-reset to the beginning of the branch you used for submitting the original Pull Request (
your-PR-branch
):git reset --soft $(git merge-base gh-pages your-PR-branch)
-
Create a new branch for a (smaller) pull request:
git checkout -b new-branch1 gh-pages
-
(Optional | Advanced) If you need to unstage some of the changes from the files you modified, do so with
git reset -p
. If you need to stage in (add to the "Staging area") some new changes, do so withgit add -p
git reset -p HEAD some-file.ext # or git add -p some-other-file.ext
-
Commit a subset of files for a (smaller) pull request:
git commit -m "Message" some-file.ext some-other-file-if-needed.ext # or git commit -p -m "Message" file.ext
-
Repeat steps 2 through 4 using different branch names (
new-branch2
, ...) and files. -
Submit Pull Requests using
new-branch1
,new-branch2
, ... branches. -
Close your original Pull Request created using your
your-PR-branch
branch