Skip to content

Latest commit

 

History

History
179 lines (123 loc) · 2.44 KB

File metadata and controls

179 lines (123 loc) · 2.44 KB

🧪 Advanced Git Practice Lab

Practice advanced Git concepts through real-world scenarios.


🎯 Objective

You will practice:

  • stash
  • cherry-pick
  • reflog
  • bisect
  • tags
  • hooks
  • worktree
  • submodules

🧪 LAB 1 — Git Stash

echo "change" >> file.txt
git stash
git stash list
git stash pop

🧪 LAB 2 — Cherry-Pick

git checkout -b feature
echo "fix" >> file.txt
git commit -am "fix"

git checkout main
git cherry-pick <commit>

🧪 LAB 3 — Reflog Recovery

git commit -am "test"
git reset --hard HEAD~1

git reflog
git reset --hard HEAD@{1}

🧪 LAB 4 — Git Bisect

git bisect start
git bisect bad
git bisect good <old>

🧪 LAB 5 — Git Tag

git tag -a v1.0 -m "release"
git push origin v1.0

🧪 LAB 6 — Git Hooks

cd .git/hooks
touch pre-commit
chmod +x pre-commit

🧪 LAB 7 — Git Worktree

git worktree add ../test test
git worktree list

🧪 LAB 8 — Submodules

git submodule add <repo>
git submodule update --init

🧠 Final Challenge (🔥)


Scenario

You:
- broke code
- lost commit
- need fix from another branch
- must tag release

Tasks

1. Recover commit (reflog)
2. Apply fix (cherry-pick)
3. Debug issue (bisect)
4. Save work (stash)
5. Tag version

🧠 Self Evaluation

[ ] Can I recover lost work?
[ ] Can I debug history?
[ ] Can I apply specific commits?
[ ] Can I manage multiple branches?
[ ] Can I use advanced tools?

🎯 Final Outcome

You are now:

🔥 Advanced Git User
🔥 Debugging Expert
🔥 Workflow Optimizer

🏁 Final Message

If you can complete this lab confidently, you understand Git better than most developers.


🚀 Next Level

Move to:

👉 08-GitHub-Pro-Level/README.md