Lesson07
intermediateCopy a Commit with git cherry-pick
Goal
Bring one commit from another branch onto main, and nothing else.
feature/charts is weeks from ready, but one of its commits, Fix currency rounding, fixes a bug customers are hitting on main today. Merging the branch would also bring in the unfinished charts.
Copy just the fix onto main.
Objectives
0/3mainhas theFix currency roundingchange. (Current objective)maindoes not haveAdd charts. (Not started)maindoes not haveAnimate chartseither. (Not started)
Your task nowStep 1 of 3
main has the Fix currency rounding change.
Need help?
Reference
Picking one commit
$ git cherry-pick 7d1e4a2
[main 9b3f0c8] Fix currency rounding Date: Mon Oct 5 10:12:44 2026 +0200 1 file changed, 1 insertion(+), 1 deletion(-)
Git applies the same change on top of your branch as a new commit, with the same message and author. The original stays on its branch; the copy gets a new id.
A copy, not a move
Step 1 of 2
main needs F2, the fix, but not F1 or F3.
Step 1 of 2. `main` needs F2, the fix, but not F1 or F3.
Preparing your workspace…
Repository Graph
Click a commit to inspect it
Working Tree
Not a Git repository yet
No unstaged changes
Your working tree matches the staging area.
Staging Area
Files prepared for the next commit
No staged changes
Use git add to prepare files for your next commit.
Repository
Committed history
No commits yet
Use git commit to record staged changes.
