Skip to content

Commit

Permalink
Added note about force pushing
Browse files Browse the repository at this point in the history
  • Loading branch information
k88hudson committed Jul 25, 2014
1 parent 69afe5e commit 0b1f8fe
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 0b1f8fe

Please sign in to comment.