Repository Commands
- git init – Initialize a repository
- git clone <repo> – Clone a repository
- git remote -v – Show remote URLs
- git remote add origin <url> – Add a remote repository
Staging & Committing
- git add <file> – Stage changes
- git add . – Stage all changes
- git commit -m "message" – Commit staged changes
- git status – Show status of files
- git diff – Show differences not staged
Branching Commands
- git branch – List branches
- git branch <branch> – Create a new branch
- git checkout <branch> – Switch branch
- git merge <branch> – Merge branch into current
Remote Commands
- git fetch – Fetch from remote
- git pull – Fetch and merge from remote
- git push – Push commits to remote
Advanced Commands
- git rebase – Reapply commits on another base
- git stash – Temporarily save changes
- git cherry-pick <commit> – Apply a specific commit
- git log – Show commit history
- git reset – Undo changes
← Back to Lesson 3: Version Control with Git