DesignerPK tools Kit logotools
TXT-17

Git Command Cheatsheet

Searchable reference for common Git commands.

Runs in your browserNothing sent to a server

34 of 34 commands

Setup

git init

Create a new empty repository in the current directory.

git clone <url>

Copy an existing repository to your local machine.

git config --global user.name "name"

Set the name used in your commits.

Basics

git status

Show changed, staged, and untracked files.

git add <file>

Stage a file's changes for the next commit.

git add .

Stage all changes in the current directory.

git commit -m "message"

Record staged changes with a message.

git commit --amend

Edit the most recent commit instead of creating a new one.

git diff

Show unstaged changes compared to the last commit.

git diff --staged

Show staged changes compared to the last commit.

History

git log

Show commit history for the current branch.

git log --oneline --graph

Show a compact, graph-style commit history.

git show <commit>

Show the changes introduced by a specific commit.

git blame <file>

Show who last changed each line of a file.

Branching

git branch

List local branches.

git branch <name>

Create a new branch.

git switch <branch>

Switch to an existing branch.

git switch -c <branch>

Create a new branch and switch to it.

git merge <branch>

Merge another branch into the current branch.

git rebase <branch>

Reapply commits on top of another branch.

git branch -d <branch>

Delete a local branch (only if merged).

Remote

git fetch

Download commits and branches from a remote without merging.

git pull

Fetch from a remote and merge into the current branch.

git push

Upload local commits to a remote branch.

git push -u origin <branch>

Push a branch and set it to track the remote branch.

git remote -v

List remotes and their URLs.

Undo

git reset --soft HEAD~1

Undo the last commit but keep changes staged.

git reset --hard HEAD~1

Undo the last commit and discard the changes entirely.

git checkout -- <file>

Discard local changes to a file.

git revert <commit>

Create a new commit that undoes a previous commit.

git stash

Temporarily shelve uncommitted changes.

git stash pop

Re-apply the most recently stashed changes.

Tags

git tag <name>

Create a tag at the current commit.

git tag -a <name> -m "message"

Create an annotated tag with a message.

What is this tool?

Git Command Cheatsheet is a searchable quick reference for commonly used Git commands. It helps developers quickly find the command and syntax they need without searching through lengthy documentation.

How does it work?

Search the cheatsheet by command, keyword, or task to find relevant Git commands and their descriptions. The reference is available directly in the browser so common Git operations can be looked up quickly.

Key features

  • Search common Git commands quickly
  • Useful reference for everyday Git workflows
  • Find commands by keyword or task
  • Helpful for beginners and experienced developers
  • Quickly review Git command syntax
  • Browser-based reference with no setup required

How to use

  1. Open the Git Command Cheatsheet.
  2. Search for a Git command, keyword, or task.
  3. Review the matching command and its usage.
  4. Copy the command syntax when needed.
  5. Clear the search to browse other Git commands.

FAQ

What is Git?

Git is a distributed version control system used to track changes in files and collaborate on software projects.

Who can use this Git cheatsheet?

It is useful for both beginners learning Git and experienced developers who need a quick reference for commonly used commands.

Can I search for a specific Git command?

Yes — use the search feature to find commands by their name, keyword, or the task you want to perform.

Does the cheatsheet run Git commands for me?

No — it is a reference tool that helps you find and understand Git commands. You still need to run the commands in your own terminal or development environment.

Related tools

More in Text Tools