mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-22 00:29:37 +01:00
TIL: Cherry picking commits from another branch
This commit is contained in:
parent
d5f4afcf99
commit
d697d97027
13
git/cherry-picking-commits-from-another-branch.md
Normal file
13
git/cherry-picking-commits-from-another-branch.md
Normal file
@ -0,0 +1,13 @@
|
||||
You have a commit which contains a good code change but it is in another branch?
|
||||
|
||||
```
|
||||
# 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
|
||||
```
|
Loading…
Reference in New Issue
Block a user