Last active
April 1, 2024 20:44
-
-
Save longtimeago/f7055aa4c3bba8a62197 to your computer and use it in GitHub Desktop.
Revisions
-
longtimeago revised this gist
Mar 27, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ ## How to squash commits in a GitHub pull request o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. -
longtimeago created this gist
Mar 27, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ How to squash commits in a GitHub pull request o you've contributed some code to an open source project, say, Rails. And they'd like you to squash all of the commits in your pull request. But you're not a git wizard; how do you make this happen? Normally, you'd do something like this. I'm assuming upstream is a git remote that is pointing at the official project repository, and that your changes are in your 'omgpull' branch: ``` $ git fetch upstream $ git checkout omgpull $ git rebase -i upstream/master < choose squash for all of your commits, except the first one > < Edit the commit message to make sense, and describe all your changes > $ git push origin omgpull -f ```