gitpractice.dev

brewly — Ch.7 · Take just one commit

Exercise 4 of 6

Before you start

Cherry-picking

git cherry-pick <commit> copies the change of one commit onto the branch you are on, as a new commit.

Name it by its short id, or relative to its branch: <branch>~1 is one before the tip.

git log --oneline <branch>
list that branch’s commits
git cherry-pick <commit>
copy one commit here
You can reopen this any time with “Lesson”.

Continue on a desktop

Typing git on a small screen is no fun. Open this page on a laptop or desktop to practise.

Back to the path