Changes between Version 30 and Version 31 of CollaborateOnGithub


Ignore:
Timestamp:
Oct 17, 2009, 3:49:50 AM (15 years ago)
Author:
mrts
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CollaborateOnGithub

    v30 v31  
    167167=== If something went wrong ===
    168168
    169 The following may wreak havoc if someone has forked your branches. If not, it should be relatively safe.
     169If you haven't done anything out of the ordinary, but see
     170{{{
     171$ git push
     172...
     173! [rejected]        master -> master (non-fast forward)
     174...
     175}}}
     176then most likely your branch (`master` in this case) is out of sync with the remote branch.
     177{{{
     178git pull
     179}}}
     180should alleviate the problem and `git push` should work again.
     181
     182Generally, `non-fast forward` means that the local history differs from the remote history and pushing would change remote history.
     183Although rewriting history may wreak havoc if someone has forked your repository after the changed point, it is sometimes necessary.
    170184
    171185==== On `master` ====
     
    175189git checkout master
    176190git reset --hard upstream/master
     191}}}
     192
     193If the reset changes history, you'll get the `non-fast forward` error when doing a `git push`. A forced push is required in this case:
     194{{{
    177195git push --force
    178196}}}
     
    205223This works for all other similar problems as well, e.g. for backing out a merge.
    206224
    207 You will probably need to use `--force` to push changes back to !GitHub
     225As above, if you've changed history, you need to issue a forced push:
    208226{{{
    209227git push --force
Back to Top