From 1d0003bb70d2ef7505a264f20ae4b32bdae414b4 Mon Sep 17 00:00:00 2001 From: Bjarke Sporring Date: Wed, 21 Jan 2026 12:08:13 +0100 Subject: [PATCH] refactor(cherry-pick): more `ls` commands to check content of challenge when switching branches --- 01-essentials/05-cherry-pick/README.md | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/01-essentials/05-cherry-pick/README.md b/01-essentials/05-cherry-pick/README.md index b1068f1..920fb26 100644 --- a/01-essentials/05-cherry-pick/README.md +++ b/01-essentials/05-cherry-pick/README.md @@ -52,10 +52,13 @@ First, see what commits are on the development branch: ```pwsh cd challenge -# View all commits on development branch -git log --oneline development +# First let's see what files are in the current branch and notice that there is a file security.py +ls -# View the full commit graph +# View all commits on development branch +git log --oneline --graph + +# View the full commit graph for all branches git log --oneline --graph --all ``` @@ -87,6 +90,9 @@ git switch main # Verify you're on main git branch + +# See what files exist. Notice that we no longer have a security.py file +ls ``` The `*` should be next to `main`. @@ -96,8 +102,6 @@ The `*` should be next to `main`. # See main's commits git log --oneline -# See what files exist -ls ``` Main should only have the initial app and README - no bug fixes yet, no experimental features. @@ -110,26 +114,24 @@ Now copy the bug fix commits from development to main: - Look for a commit message like "Fix security vulnerability in input validation" - Note its hash (first 7 characters) -2. First let's just check whether or not we have the `security.py` and `cache.py` file available by running `ls` in the challenge directory or check the file explorer in your VSCode - -3. Cherry-pick the security fix: +2. Cherry-pick the security fix: ```pwsh git cherry-pick # Example if the hash is abc1234: # git cherry-pick abc1234 ``` -4. Verify it worked: Check that security.py, with `ls` or check your file explorer in VSCode, now exists and check that the commit has been added to the main branch with `git log --oneline --graph --all` -5. Find the performance fix commit hash +3. Verify it worked: Check that security.py, with `ls` or check your file explorer in VSCode, now exists and check that the commit has been added to the main branch with `git log --oneline --graph --all` +4. Find the performance fix commit hash - Look for "Fix performance issue with data caching" - Note its hash -6. Cherry-pick the performance fix: +5. Cherry-pick the performance fix: ```pwsh git cherry-pick ``` -7. Verify both fixes are now on main: +6. Verify both fixes are now on main: ```pwsh # You should see both security.py and cache.py ls