[Starlingx-discuss] cherry-pick a fix from master to stx.2.0
# Check out the 2.0 branch BRANCH=r/stx.2.0 repo init -u https://opendev.org/starlingx/manifest -b $BRANCH repo sync --force-sync
# change directory to the destination repo and start a working branch. e.g. cd cgcs-root/stx/stx-integ repo start my-branch
# a) Normal case. The commit is already commited on the master branch
# Find the sha of the commit you wish to cherry pick git log remotes/starlingx/master
git cherry-pick <sha>
# b) The commit is still under review in gerrit
# Point your browser at the review e.g. https://review.opendev.org/#/c/674719/ # In the upper right hand corner find the 'Download' button to expand the sub-menu. # Find the 'cherry-pick' option. On the right you'll find a button that fill copy cherry pick commands to your clip-board. # Paste the cherry pick commands into your shell. It will look something like ... git fetch https://review.opendev.org/starlingx/integ refs/changes/19/674719/1 && git cherry-pick FETCH_HEAD
# You cherry-pick might not apply cleanly. If there is a conflict ...
# Edit files that report conflicts. vi <file>
# Look for conflict markers '<<<<<<<' and '>>>>>>>' that show the competing changes. # Resolve the conflict and remove the conflict markers.
# save changed 'git add <file>'
# resume the cherry-pick git cherry-pick --continue
# Test your change
# Submit for review git review -s git review
On 2019-08-13 12:03:56 -0400 (-0400), Scott Little wrote: [...]
# b) The commit is still under review in gerrit
# Point your browser at the review e.g. https://review.opendev.org/#/c/674719/ # In the upper right hand corner find the 'Download' button to expand the sub-menu. # Find the 'cherry-pick' option. On the right you'll find a button that fill copy cherry pick commands to your clip-board. # Paste the cherry pick commands into your shell. It will look something like ... git fetch https://review.opendev.org/starlingx/integ refs/changes/19/674719/1 && git cherry-pick FETCH_HEAD
[...]
You can also simply `git review -x 674719` to cherry-pick a change from Gerrit into your current branch.
participants (2)
-
Jeremy Stanley
-
Scott Little