Updated Squashing Commits (markdown)

yurydelendik 2012-10-04 06:36:44 -07:00
parent 3e0d74fbe3
commit fa0494292b

@ -1,7 +1,7 @@
We try to keep the history for pdf.js relatively clean and we may ask contributors to "squash" their commits before we merge. We try to keep the history for pdf.js relatively clean and we may ask contributors to "squash" their commits before we merge.
**Note:** **Note:**
These directions assume that you named the Mozilla pdf.js repo (not your fork) `upstream` and you have a branch called `super-feature`. These directions assume that you named the Mozilla pdf.js repo (not your fork) `upstream` and you have a branch called `super-feature`. See [[Contributing]] for details.
1. Add the following to your git config. Either the global one or the config within your pdf.js fork (`.git/config`). 1. Add the following to your git config. Either the global one or the config within your pdf.js fork (`.git/config`).
```bash ```bash
@ -16,4 +16,23 @@ git squash super-feature
1. Then update the pull request: 1. Then update the pull request:
```bash ```bash
git push --force origin super-feature git push --force origin super-feature
``` ```
## Alternatives
1. Step-by-step commands
```
# resets HEAD to the current upstream
git checkout upstream/master
# merges all commits from the local branch
git merge --no-commit --squash super-feature
# re-creates the branch starting from current HEAD (old commits will be lost)
git checkout -B super-feature
# lets you edit the commit and checks in the changes
git commit -e
```
1. Or, you just use rebase (let's say you have 5 commits to merge)
```
git rebase -i HEAD~5
```
Change pick to squash for last four and update the commit message.