Skip to content

Commit d51e035

Browse files
committed
docs: update CONTRIBUTING.md to clarify cherry-pick instructions
1 parent e8274be commit d51e035

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

CONTRUBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010

1111
The `internal` branch needs to stay updated with the `main` branch. However, trying to merge will result in potential breaking changes and problems. For most cases, we want to merge only the latest commit from `main` into `internal`.
1212

13-
I found a nice way to do what we want [Cherry Pick](https://betterstack.com/community/questions/how-to-selectively-merge-or-pick-changes-from-another-branch-in-git/)
13+
If we want to apply a small number of commits to `internal`, we can use [Cherry Pick](https://betterstack.com/community/questions/how-to-selectively-merge-or-pick-changes-from-another-branch-in-git/). This lets us apply only certain commits. However, it can be potentially tricky to cherry pick a merge commit. It is better to cherry pick individual commits, therefore this method is better suited to a small number of commits.
14+
15+
If you have a lot of commits, you can cherry pick a merge commit, but you have to specify which changes you want relative to the parents (your feature branch and main). In most cases we only want changes introduced by our feature branch, which would be the 2nd branch.
1416

1517
### Steps
1618

1719
- Get latest main commit hash that you want to merge with internal
18-
- go to internal and type `git cherry-pick <commit hash>`
19-
- resolve merge conflicts if necessary
20-
- make sure to add all files to stage changes (none should be in merge changes)
21-
- commit and push as normal
20+
- Go to internal and type `git cherry-pick <commit hash>` or `git cherry-pick <commit hash> -m 2` if you are cherry picking a merge commit
21+
- Resolve merge conflicts if necessary
22+
- Make sure to add all files to stage changes (none should be in merge changes)
23+
- Commit and push as normal

0 commit comments

Comments
 (0)