Changes between Version 86 and Version 87 of HowToGit
- Timestamp:
- 04/08/20 05:41:26 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
HowToGit
v86 v87 234 234 === Backporting of a single commit from master to release branch === 235 235 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 236 Assumptions: 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 241 First, before you do the //git cherry-pick//, update the local repo and fork to state of upstream with the following four steps. 242 243 Get latest changes to your machine: 244 245 {{{ 244 246 git fetch --all --prune 247 }}} 248 249 Go to the branch: 250 251 {{{ 245 252 git checkout releasebranch_7_8 246 git merge upstream/releasebranch_7_8 253 }}} 254 255 Update the local branch with latest changes from upstream: 256 257 {{{ 258 git rebase upstream/releasebranch_7_8 259 }}} 260 261 Update your the branch in your fork (optional, just to keep things organized): 262 263 {{{ 247 264 git 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 267 Second, get commit hash from !GitHub or //git log// in master. 268 269 Third, cherry-pick the change from master into the branch: 270 271 {{{ 253 272 git cherry-pick <hash> 254 255 #(or 256 #git cherry-pick -m1 hash 257 #when cherry picking a merge request) 258 259 # verify 273 }}} 274 275 Forth, verify: 276 {{{ 277 git status 278 git log 260 279 git show 261 262 # push backport to releasebranch upstream 280 }}} 281 282 Fifth, push backport to the branch in upstream: 283 284 {{{ 263 285 git push upstream releasebranch_7_8 264 286 }}} 265 287 266 288 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 rebase// command as before. 267 289 === Made a mess? Fix it === 268 290