feat: use switch instead of checkout

This commit is contained in:
Bjarke Sporring
2026-01-05 12:38:35 +01:00
parent a7b511c8cb
commit e29b9bca70
8 changed files with 55 additions and 44 deletions

View File

@@ -121,10 +121,10 @@ The verification will check that:
3. Check status: `git status` (you'll see modified files)
4. Stash your changes: `git stash save "WIP: login feature"`
5. Verify working directory is clean: `git status`
6. Switch to main: `git checkout main`
6. Switch to main: `git switch main`
7. View the bug in app.js and fix it (remove the incorrect line)
8. Commit the fix: `git add app.js && git commit -m "Fix critical security bug"`
9. Switch back to feature: `git checkout feature-login`
9. Switch back to feature: `git switch feature-login`
10. Restore your work: `git stash pop`
11. Complete the feature (the TODOs in login.js)
12. Commit your completed feature
@@ -147,9 +147,9 @@ The verification will check that:
```bash
# Working on feature, need to switch to main
git stash
git checkout main
git switch main
# Do work on main
git checkout feature
git switch feature
git stash pop
```
@@ -176,10 +176,10 @@ git stash pop # Restore original work
```bash
# Same fix needed on multiple branches
git stash
git checkout branch1
git switch branch1
git stash apply
git commit -am "Apply fix"
git checkout branch2
git switch branch2
git stash apply
git commit -am "Apply fix"
git stash drop # Clean up when done