Skip to content
All references

Development reference

Git Commands

Common Git inspection and everyday workflow commands, with clear notes about operations that change state.

10 of 10 entries

Inspect

Working tree status

git status --short

Shows staged, unstaged and untracked paths.

Inspect

Unstaged differences

git diff -- src/

Shows tracked changes not yet staged, limited here to src/.

Inspect

Staged differences

git diff --cached

Review the exact changes prepared for your next commit.

Inspect

Recent commits

git log --oneline -10

Lists ten recent commits from the current history.

Inspect

Branches

git branch --all

Lists local and remote-tracking branch names.

Change

New branch

git switch -c feature/example

Creates and switches to a local branch; requires a sufficiently recent Git.

Change

Stage a file

git add -- src/example.ts

Stages this file’s current content. Review it with git diff --cached.

Change

Commit staged changes

git commit -m "Explain the change"

Creates a local commit from the index. It does not publish to a remote.

Remote

Fetch remote history

git fetch origin

Updates remote-tracking information without merging into your working branch.

Remote

Publish a branch

git push -u origin feature/example

Publishes local commits to the named remote branch; inspect the destination first.