Git Commands

Technology 51 records updated 2026-07-19

Git Commands, with command, category, description, and example.

Get this data

GET https://mysafeinfo.com/api/data/gitcommands

JSON XML CSV Download CSV

Sort, page, randomize, and download with query parameters; see the documentation.

Without a key, responses return up to 50 rows. A pass returns all 51 records.

Try it live

Run a request against gitcommands straight from your browser. Add your API key to lift the row cap and return every record. The call goes to the API and nothing is stored here.

Preview

First 25 of 51 records. Click a column to sort these rows.

ID Command Category Description Example
1 git init Basics Create an empty Git repository or reinitialize an existing one git init
2 git clone Basics Clone a repository into a new directory git clone https://github.com/u/r.git
3 git add Basics Add file contents to the staging area git add .
4 git status Basics Show the working tree status git status
5 git commit Basics Record staged changes to the repository git commit -m "message"
6 git diff Basics Show changes between commits and the working tree git diff
7 git rm Basics Remove files from the working tree and the index git rm file.txt
8 git mv Basics Move or rename a file, directory, or symlink git mv old.txt new.txt
9 git grep Basics Print lines matching a pattern in tracked files git grep "TODO"
10 git ls-files Basics Show information about files in the index and working tree git ls-files
11 git ls-tree Basics List the contents of a tree object git ls-tree HEAD
12 git archive Basics Create an archive of files from a named tree git archive -o repo.zip HEAD
13 git log History Show commit logs git log --oneline
14 git show History Show various types of objects such as commits git show HEAD
15 git shortlog History Summarize git log output by author git shortlog -sn
16 git blame History Show what revision and author last changed each line git blame file.txt
17 git reflog History Manage the record of updates to branch tips git reflog
18 git bisect History Use binary search to find the commit that introduced a bug git bisect start
19 git describe History Give a commit a human readable name based on a ref git describe --tags
20 git difftool History Show changes using common external diff tools git difftool
21 git range-diff History Compare two commit ranges git range-diff main..feature
22 git rev-list History List commit objects in reverse chronological order git rev-list HEAD
23 git branch Branching List, create, or delete branches git branch -a
24 git checkout Branching Switch branches or restore working tree files git checkout -b feature
25 git switch Branching Switch to another branch git switch main

Notes