0
0
Gitdevops~5 mins

Cherry-picking multiple commits in Git - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does git cherry-pick do?
It copies the changes introduced by a commit from one branch and applies them onto the current branch.
Click to reveal answer
intermediate
How do you cherry-pick multiple commits in one command?
Use git cherry-pick commit1 commit2 commit3 listing all commit hashes separated by spaces.
Click to reveal answer
intermediate
What is a common problem when cherry-picking multiple commits?
Conflicts can happen if the commits change the same lines as the current branch. You must resolve conflicts manually.
Click to reveal answer
intermediate
How can you cherry-pick a range of commits?
Use git cherry-pick start_commit^..end_commit to pick all commits from start_commit to end_commit inclusive.
Click to reveal answer
beginner
What should you do if a cherry-pick results in conflicts?
Resolve the conflicts in files, then run git cherry-pick --continue to finish applying the commits.
Click to reveal answer
Which command cherry-picks commits a1b2c3 and d4e5f6 onto the current branch?
Agit cherry-pick a1b2c3..d4e5f6
Bgit merge a1b2c3 d4e5f6
Cgit cherry-pick a1b2c3 d4e5f6
Dgit rebase a1b2c3 d4e5f6
How do you cherry-pick all commits from abc123 to def456 inclusive?
Agit cherry-pick abc123^..def456
Bgit cherry-pick abc123-def456
Cgit cherry-pick def456..abc123
Dgit cherry-pick abc123..def456
What should you do after resolving conflicts during a cherry-pick?
Agit cherry-pick --abort
Bgit cherry-pick --continue
Cgit commit --amend
Dgit reset --hard
If you want to cancel a cherry-pick in progress, which command do you use?
Agit cherry-pick --abort
Bgit cherry-pick --continue
Cgit reset --soft
Dgit revert
Cherry-picking is best described as:
AMerging two branches completely
BDeleting commits from history
CCreating a new branch
DCopying specific commits from one branch to another
Explain how to cherry-pick multiple commits and handle conflicts if they arise.
Think about the steps from selecting commits to finishing the process.
You got /4 concepts.
    Describe the difference between cherry-picking a range of commits and cherry-picking individual commits.
    Consider how you specify commits in the command.
    You got /4 concepts.