Changes between Version 86 and Version 87 of HowToGit


Ignore:
Timestamp:
04/08/20 05:41:26 (5 years ago)
Author:
wenzeslaus
Comment:

Replace git merge with git rebase. Drop the merging a merge commit instruction. Add recovery from outdated repo. Change structure to text and single commands..

Legend:

Unmodified
Added
Removed
Modified
  • HowToGit

    v86 v87  
    234234=== Backporting of a single commit from master to release branch ===
    235235
    236 ... we are in releasebranch_7_8 branch:
    237 
    238 {{{
    239 # assumptions:
    240 # - the own fork is defined as "origin"
    241 # - the remote repo is defined as "upstream"
    242 
    243 # 1. update the local copy and fork to state of remote repo
     236Assumptions:
     237* Your own fork is defined as "origin".
     238* The OSGeo repo is defined as "upstream".
     239* Using releasebranch_7_8 branch in the examples as the branch to backport to.
     240
     241First, before you do the //git cherry-pick//, update the local repo and fork to state of upstream with the following four steps.
     242
     243Get latest changes to your machine:
     244
     245{{{
    244246git fetch --all --prune
     247}}}
     248
     249Go to the branch:
     250
     251{{{
    245252git checkout releasebranch_7_8
    246 git merge upstream/releasebranch_7_8
     253}}}
     254
     255Update the local branch with latest changes from upstream:
     256
     257{{{
     258git rebase upstream/releasebranch_7_8
     259}}}
     260
     261Update your the branch in your fork (optional, just to keep things organized):
     262
     263{{{
    247264git push origin releasebranch_7_8
    248 
    249 
    250 # 2. get hash from GitHub or git log in master
    251 
    252 # 3. cherry-pick the change from master into releasebranch branch
     265}}}
     266
     267Second, get commit hash from !GitHub or //git log// in master.
     268
     269Third, cherry-pick the change from master into the branch:
     270
     271{{{
    253272git cherry-pick <hash>
    254 
    255 #(or
    256 #git cherry-pick -m1 hash
    257 #when cherry picking a merge request)
    258 
    259 # verify
     273}}}
     274
     275Forth, verify:
     276{{{
     277git status
     278git log
    260279git show
    261 
    262 # push backport to releasebranch upstream
     280}}}
     281
     282Fifth, push backport to the branch in upstream:
     283
     284{{{
    263285git push upstream releasebranch_7_8
    264286}}}
    265287
    266 
     288This 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 rebase// command as before.
    267289=== Made a mess? Fix it ===
    268290