Repository statusGit
git status
Show tracked, staged, and untracked files at a glance.
git status -sb
Status inspection, branching strategies, commits, and collaboration.
Show tracked, staged, and untracked files at a glance.
git status -sb
Inspect commit history with optional graphing.
git log --oneline --graph --decorate --all
Compare file changes between commits, branches, or workspace states.
git diff HEAD~1
git switch
Switch branches or restore files to a known state.
git switch <branch>
Combine commits from a source branch into the current branch.
git merge <branch>
Replay commits onto a new base for linear history.
git rebase origin/main
Stage files or hunks before committing.
git add <file>
Record staged changes with messages and metadata.
git commit -m "<message>"
Temporarily shelve uncommitted work.
git stash push -m "<label>"
Download remote refs without merging them.
git fetch origin
Fetch and integrate remote changes.
git pull --rebase origin main
Publish local commits to remotes.
git push origin <branch>