... | @@ -88,6 +88,31 @@ y |
... | @@ -88,6 +88,31 @@ y |
|
# repo2's and repo3's file now contains lines 1,3,4,5,7
|
|
# repo2's and repo3's file now contains lines 1,3,4,5,7
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
Git:
|
|
|
|
|
|
|
|
```wiki
|
|
|
|
mkdir testrepo
|
|
|
|
cd testrepo
|
|
|
|
git init
|
|
|
|
printf 'Line1\nLine3\nLine5\nLine7\n' > file
|
|
|
|
git add *
|
|
|
|
git commit -a -m patch1
|
|
|
|
|
|
|
|
# create the branch (we only need one)
|
|
|
|
git checkout -b branch1 # also switches to the branch
|
|
|
|
git checkout master # switch back to master
|
|
|
|
|
|
|
|
printf 'Line1\nLine2\nLine3\nLine5\nLine6\nLine7\n' > file
|
|
|
|
git commit -a -m patch2
|
|
|
|
printf 'Line1\nLine2\nLine3\nLine4\nLine5\nLine6\nLine7\n' > file
|
|
|
|
git commit -a -m patch3
|
|
|
|
|
|
|
|
git log --grep=patch3 # prints the commit id for that change
|
|
|
|
git checkout branch1
|
|
|
|
git cherry-pick <commit-id from above>
|
|
|
|
```
|
|
|
|
|
|
### Cherry-picking during record
|
|
### Cherry-picking during record
|
|
|
|
|
|
|
|
|
... | | ... | |