All chapters in this track
- 011. The Mental Model
- 022. Essential Setup
- 033. Core Daily Workflow
- 044. Branching
- 055. Merging & Conflict Resolution
- 066. Rebasing
- 077. Remote Repositories
- 088. Stashing
- 099. Undoing Things
- 1010. Tagging & Versioning
- 1111. Cherry-Pick
- 1212. Git Bisect & Blame
- 1313. Git Hooks
- 1414. Submodules
- 1515. Team Workflows
- 1616. Power Commands & Aliases
- 1717. Reflog: The Safety Net
- 1818. Practice Tasks
- 19Quick Reference Cheatsheet
Chapter 3 of 19
3. Core Daily Workflow
# Check what's changed
git status # overview
git diff # unstaged changes (working dir vs staging)
git diff --staged # staged changes (staging vs last commit)
# Stage changes
git add file.txt # stage one file
git add src/ # stage a folder
git add -p # interactive: stage hunks (partial file staging)
git add . # stage everything (use carefully)
# Commit
git commit -m "feat: add login endpoint"
git commit # opens editor for multi-line message
git commit --amend # rewrite the LAST commit (message + content)
git commit --amend --no-edit # amend content, keep message
# View history
git log # full log
git log --oneline --graph --all # compact visual graph
git log -p # log + diffs
git log --author="Alice" # filter by author
git log --since="2 weeks ago"
git log -- path/to/file # history of one file
# Show a commit
git show <commit-hash>
git show HEAD~2 # 2 commits before HEAD
Good commit messages (Conventional Commits)
<type>(<scope>): <short summary>
[optional body]
[optional footer: BREAKING CHANGE, Closes #123]
Types: feat fix docs style refactor test chore
feat(auth): add JWT refresh token support
fix(cart): prevent duplicate item on re-add
docs: update API setup instructions