Changes between Version 99 and Version 100 of HowToGit
- Timestamp:
- 02/06/22 09:48:54 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HowToGit
v99 v100 57 57 git remote add upstream git@github.com:OSGeo/grass-addons.git 58 58 }}} 59 59 60 === Working with Git === 60 61 … … 72 73 # (HEAD -> main, upstream/main) 73 74 74 ### b) updating releasebranch_ 7_875 ### b) updating releasebranch_8_0 75 76 # switch to branch 76 77 # only once 77 git checkout -b releasebranch_ 7_8 origin/releasebranch_7_878 # next time, git checkout releasebranch_ 7_878 git checkout -b releasebranch_8_0 origin/releasebranch_8_0 79 # next time, git checkout releasebranch_8_0 79 80 80 81 # merge updates into local branch 81 git merge upstream/releasebranch_ 7_882 git merge upstream/releasebranch_8_0 82 83 83 84 # at this point we have reached: 84 # (HEAD -> releasebranch_ 7_8, upstream/releasebranch_7_8)85 # (HEAD -> releasebranch_8_0, upstream/releasebranch_8_0) 85 86 86 87 # update own remote … … 175 176 176 177 If you have access to one of the OSGeo repositories (namely OSGeo/grass in this case), before force pushing, you need be sure that origin points to your fork and not the OSGeo repo. You can check that using `git remote -v`. 178 177 179 == Switching between branches == 178 180 … … 260 262 * pr/832 261 263 pr/837 262 releasebranch_7_6263 264 releasebranch_7_8 265 releasebranch_8_0 264 266 265 267 # Delete all PRs: … … 273 275 To directly fix bugs (ideally via feature branch), do 274 276 275 (example: https://github.com/OSGeo/grass/tree/releasebranch_ 7_8)277 (example: https://github.com/OSGeo/grass/tree/releasebranch_8_0) 276 278 277 279 {{{ 278 280 # push to release_branch, we assume it to be checked out 279 281 280 cd releasebranch_ 78/282 cd releasebranch_80/ 281 283 # be sure to locally have all updates from server 282 284 git fetch --all … … 284 286 285 287 # create feature branch 286 git checkout -b r 78_fix_xxx288 git checkout -b r80_fix_xxx 287 289 288 290 # ... do changes... … … 293 295 294 296 # push to feature branch 295 git push upstream r 78_fix_xxx297 git push upstream r80_fix_xxx 296 298 }}} 297 299 … … 305 307 {{{ 306 308 # switch to release branch 307 git checkout releasebranch_ 7_8309 git checkout releasebranch_8_0 308 310 309 311 # be sure to locally have all updates … … 312 314 313 315 # delete local feature branch as no longer needed 314 git branch -D r 78_fix_xxx316 git branch -D r80_fix_xxx 315 317 git fetch --all --prune 316 318 git branch -a … … 334 336 * Your own fork is defined as "origin". 335 337 * The OSGeo repo is defined as "upstream". 336 * Using releasebranch_ 7_8branch in the examples as the branch to backport to.338 * Using releasebranch_8_0 branch in the examples as the branch to backport to. 337 339 338 340 First, before you do the //git cherry-pick//, update the local repo and fork to state of upstream with the following four steps. … … 347 349 348 350 {{{ 349 git checkout releasebranch_ 7_8351 git checkout releasebranch_8_0 350 352 }}} 351 353 … … 353 355 354 356 {{{ 355 git rebase upstream/releasebranch_ 7_8357 git rebase upstream/releasebranch_8_0 356 358 }}} 357 359 … … 359 361 360 362 {{{ 361 git push origin releasebranch_ 7_8363 git push origin releasebranch_8_0 362 364 }}} 363 365 … … 380 382 381 383 {{{ 382 git push upstream releasebranch_ 7_8384 git push upstream releasebranch_8_0 383 385 }}} 384 386 385 387 This last steps will fail if somebody else did backport after you did the rebase step above. If that's the case, just update your local branch again with the same //git fetch// and //git rebase// commands as before. 388 386 389 === Made a mess? === 387 390 … … 398 401 }}} 399 402 400 Make sure you are on the right branch (here using releasebranch_ 7_8):401 402 {{{ 403 git checkout releasebranch_ 7_8403 Make sure you are on the right branch (here using releasebranch_8_0): 404 405 {{{ 406 git checkout releasebranch_8_0 404 407 }}} 405 408 … … 407 410 408 411 {{{ 409 git reset --hard upstream/releasebranch_ 7_8412 git reset --hard upstream/releasebranch_8_0 410 413 }}} 411 414 … … 414 417 {{{ 415 418 git fetch --all --prune 416 git rebase upstream/releasebranch_ 7_8419 git rebase upstream/releasebranch_8_0 417 420 }}} 418 421 … … 420 423 421 424 {{{ 422 git push --force origin releasebranch_ 7_8425 git push --force origin releasebranch_8_0 423 426 }}} 424 427