From 0b1f8fe4b613c648f9141ff0ddc14c7f6e6ae763 Mon Sep 17 00:00:00 2001 From: Kate Hudson Date: Fri, 25 Jul 2014 14:31:09 -0400 Subject: [PATCH] Added note about force pushing --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 435dc9bf..e8b9ec5c 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,23 @@ If at any time you want to stop the entire rebase and go back to the original st (my-branch)$ git rebase --abort ``` +#### When I try to push, I get an error message: + +``` +To https://github.com/yourusername/repo.git +! [rejected] mybranch -> mybranch (non-fast-forward) +error: failed to push some refs to 'https://github.com/tanay1337/webmaker.org.git' +hint: Updates were rejected because the tip of your current branch is behind +hint: its remote counterpart. Integrate the remote changes (e.g. +hint: 'git pull ...') before pushing again. +hint: See the 'Note about fast-forwards' in 'git push --help' for details. +``` + +Since rebasing **replaces the old commit(s) with a new one**, you must force push (`-f`) your changes. Be careful when you do this! + +``` +(mybranch) $ git push origin mybranch -f +``` ## I committed to master instead of a new branch