Changes between Version 30 and Version 31 of CollaborateOnGithub
- Timestamp:
- Oct 17, 2009, 3:49:50 AM (15 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
CollaborateOnGithub
v30 v31 167 167 === If something went wrong === 168 168 169 The following may wreak havoc if someone has forked your branches. If not, it should be relatively safe. 169 If 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 }}} 176 then most likely your branch (`master` in this case) is out of sync with the remote branch. 177 {{{ 178 git pull 179 }}} 180 should alleviate the problem and `git push` should work again. 181 182 Generally, `non-fast forward` means that the local history differs from the remote history and pushing would change remote history. 183 Although rewriting history may wreak havoc if someone has forked your repository after the changed point, it is sometimes necessary. 170 184 171 185 ==== On `master` ==== … … 175 189 git checkout master 176 190 git reset --hard upstream/master 191 }}} 192 193 If 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 {{{ 177 195 git push --force 178 196 }}} … … 205 223 This works for all other similar problems as well, e.g. for backing out a merge. 206 224 207 You will probably need to use `--force` to push changes back to !GitHub 225 As above, if you've changed history, you need to issue a forced push: 208 226 {{{ 209 227 git push --force