Skip to content

Instantly share code, notes, and snippets.

@cmaggiulli
Forked from ViktorAndonov/git-cherry-pick.txt
Created September 20, 2022 16:31
Show Gist options
  • Save cmaggiulli/1b3d16e346d5725bc4867f4fa57e63d1 to your computer and use it in GitHub Desktop.
Save cmaggiulli/1b3d16e346d5725bc4867f4fa57e63d1 to your computer and use it in GitHub Desktop.
How to cherry pick commits
0.1) Use the terminal;
1) Make sure there is no changes in both branches (git status);
2) Checkout the brach that you want to take the commit from;
3) Use git log to show the full number of the commit that you want to cherry pick, and copy it from the teminal;
4) Now checkout the branch that you want to recive;
5) Then write: git cherry-pick [the number of the commit that you want to take, without brackets]
6) You are done! or if conflicts appear resolve them manually;
7) Then commit the changes;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment