From 895c074dd45a7f5439fa0bade43addbf0d6b7faf Mon Sep 17 00:00:00 2001 From: yurydelendik Date: Wed, 22 Oct 2014 12:06:56 -0700 Subject: [PATCH] Updated Squashing Commits (markdown) --- Squashing-Commits.md | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/Squashing-Commits.md b/Squashing-Commits.md index 00b4120..5d5984a 100644 --- a/Squashing-Commits.md +++ b/Squashing-Commits.md @@ -4,20 +4,23 @@ We try to keep the history for pdf.js relatively clean and we may ask contributo 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`). -```bash -[alias] - squash = !sh -c 'git checkout upstream/master && git merge --no-commit --squash $0 && git checkout -B $0 && git commit -e' -``` + ```bash + [alias] + squash = !sh -c 'git checkout upstream/master && git merge --no-commit --squash $0 && git checkout -B $0 && git commit -e' + ``` + 1. Then you simply need to do: -```bash -git merge upstream/master -git squash super-feature -``` + ```bash + git merge upstream/master + git squash super-feature + ``` + 1. That will bring up your editor to allow you to put in the commit message you want. After entering a commit message, press Esc and type `:wq` to exit the editor (if the editor is set to vim). + 1. Then update the pull request: -```bash -git push --force origin super-feature -``` + ```bash + git push --force origin super-feature + ``` ## Alternatives 1. Step-by-step commands