mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-08 18:19:37 +01:00
14 lines
320 B
Markdown
14 lines
320 B
Markdown
You have a commit which contains a good code change but it is in another branch?
|
|
|
|
```bash
|
|
# pick the commit
|
|
git cherry-pick <sha>
|
|
|
|
# apply changes introduced by commit but do not commit the changes
|
|
git cherry-pick <sha> -n
|
|
git cherry-pick <sha> --no-commit
|
|
|
|
# pick all the commits from A to B
|
|
git cherry-pick A^..B
|
|
```
|