156 | | TODO |
| 156 | === Preparation === |
| 157 | |
| 158 | If you checked out the release branch into a separate directory, be sure to have "upstream" enabled as a remote: |
| 159 | |
| 160 | {{{ |
| 161 | git remote -v |
| 162 | # if upstream is missing, execute |
| 163 | git remote add upstream git@github.com:OSGeo/grass.git |
| 164 | }}} |
| 165 | |
| 166 | |
| 167 | === Backporting of single commits === |
| 168 | |
| 169 | {{{ |
| 170 | git checkout master |
| 171 | # With git log, identify the sha1sum of the commit you want to backport (example: into releasebranch_7_6) |
| 172 | |
| 173 | # switch to branch |
| 174 | git checkout releasebranch_7_6 |
| 175 | # update |
| 176 | git pull origin releasebranch_7_6 --rebase |
| 177 | # backport the commit |
| 178 | git cherry-pick the_sha1_sum |
| 179 | # push to upstream |
| 180 | git push upstream releasebranch_7_6 |
| 181 | }}} |
| 185 | === Backporting of a merged pull request from master === |
| 186 | |
| 187 | Same as "Backporting of single commits" but with multiple `git cherry-pick ...`. Importantly, in the right order. |
| 188 | |
| 189 | TODO: there must be a better way!! |
| 190 | |
| 191 | === Made a mess? Fix it === |
| 192 | |
| 193 | Example: mess happened on releasebranch_7_6: |
| 194 | |
| 195 | {{{ |
| 196 | git reset --hard upstream/releasebranch_7_6 |
| 197 | git pull upstream releasebranch_7_6 --rebase |
| 198 | |
| 199 | # now all should be clean again |
| 200 | }}} |