Reputation: 795
I have made my first contribute to a project on GitHub. I have selected the file to edit, created a pull request, and made my edits. Then I noticed a mistake, selected the file again, and made my corrections. I always worked online, no command line. Now a contributor od the project asked me to squash my two commits. The question is: how?
Upvotes: 5
Views: 8168
Reputation: 136967
But how can I "move" from the online editor to the command line?
See Modifying an active pull request locally in GitHub's documentation:
- In any repository's right sidebar, click Pull Requests.
- In the "Pull Requests" list, click the pull request you'd like to merge.
- At the bottom of the pull request, click command line. Follow the sequence of steps to bring down the proposed pull request.
Then modify the branch locally.
In this case you'll want to squash the commits using git rebase --interactive <commit-before-yours>
. Choose to pick
your first commit and squash
your second one.
Finally, push it back to the existing PR branch on GitHub. In this case you'll have to use --force
since you're replacing your old commits with a new one.
Upvotes: 1