289 | | === Made a mess? Fix it === |
290 | | |
291 | | Example: mess happened on releasebranch_7_8: |
292 | | |
293 | | {{{ |
294 | | git reset --hard upstream/releasebranch_7_8 |
295 | | git pull upstream releasebranch_7_8 --rebase |
296 | | |
297 | | # now all should be clean again |
298 | | }}} |
299 | | |
| 289 | === Made a mess? === |
| 290 | |
| 291 | If you made a mess in the upstream repo (the OSGeo repo) or you think you did, consult on grass-dev mailing list. |
| 292 | |
| 293 | If you have something you don't like in your local branch or in the branch in your fork, you can trash any changes you made and replace your branch with whatever is in the upstream repo. |
| 294 | |
| 295 | Make sure you don't have any local changes or changes on the branch in your fork because this will wipe them out. |
| 296 | |
| 297 | Make sure your remotes are set right (see above, origin to your fork and upstream to OSGeo repo): |
| 298 | |
| 299 | {{{ |
| 300 | git remote -v |
| 301 | }}} |
| 302 | |
| 303 | Make sure you are on the right branch (here using releasebranch_7_8): |
| 304 | |
| 305 | {{{ |
| 306 | git checkout releasebranch_7_8 |
| 307 | }}} |
| 308 | |
| 309 | Bring the local branch to the state of the upstream branch trashing all local changes: |
| 310 | |
| 311 | {{{ |
| 312 | git reset --hard upstream/releasebranch_7_8 |
| 313 | }}} |
| 314 | |
| 315 | Update the local repo from the upstream: |
| 316 | |
| 317 | {{{ |
| 318 | git fetch --all --prune |
| 319 | git rebase upstream/releasebranch_7_8 |
| 320 | }}} |
| 321 | |
| 322 | If you want to keep the branch in your fork up to date, you may need to also overwrite anything which is on that branch there. Be sure you are force pushing only to origin and that origin is your fork. Force push the state of the local branch into your fork: |
| 323 | |
| 324 | {{{ |
| 325 | git push --force origin releasebranch_7_8 |
| 326 | }}} |