Start a Project
- Create new repo:
git init
- Clone existing repo:
git clone <repo-url>
Basic Workflow:
Working Directory → Staging Area → Repository
- git status
- git add .
- git commit -m “message”
- git push
Undo Mistakes
- Unstage file
- Undo last commit (keep changes)
- Discard changes
Branching
- Create branch: git branch feature-login