link

Git

Version control commands for managing repositories, branches, and commits

42 commands

Commands

42 commands available
Resources

Learn Git Deeper

Master version control with comprehensive resources

git

Initialize Repository

Create an empty Git repository

git init
git
init
repository
git

Clone Repository

Clone a repository into a new directory

git clone <repository>
git
clone
repository
git

Configure Git

Configure user information

git config
git
config
user
git

Check Repository Status

Display the working tree status

git status
git
status
repository
git

View Commit History

Show commit logs

git log
git
log
history
git

Show Commit Details

Show various types of objects

git show
git
show
commit
git

Show Changes

Show changes between commits

git diff
git
diff
changes
git

List/Create Branches

List, create, or delete branches

git branch
git
branch
list
git

Switch Branches

Switch branches or restore files

git checkout
git
checkout
branch
git

Switch Branches (New)

Switch branches (Git 2.23+)

git switch
git
switch
branch
git

Merge Branches

Join two or more development histories together

git merge
git
merge
branch
git

Rebase Branch

Reapply commits on top of another base tip

git rebase
git
rebase
branch
git

Add Files

Add file contents to the index

git add
git
add
files
git

Commit Changes

Record changes to the repository

git commit
git
commit
changes
git

Reset Changes

Reset current HEAD to the specified state

git reset
git
reset
changes
git

Restore Files

Restore working tree files (Git 2.23+)

git restore
git
restore
files
git

Revert Commit

Create new commit that undoes changes

git revert
git
revert
commit
git

Manage Remotes

Manage set of tracked repositories

git remote
git
remote
repository
git

Fetch from Remote

Download objects and refs from another repository

git fetch
git
fetch
remote
git

Pull from Remote

Fetch from and integrate with another repository

git pull
git
pull
remote
git

Push to Remote

Update remote refs along with associated objects

git push
git
push
remote
git

Stash Changes

Stash the changes in a dirty working directory away

git stash
git
stash
changes
git

Apply Stash

Apply stashed changes

git stash apply
git
stash
changes
git

Manage Tags

Create, list, delete tags

git tag
git
tag
repository
git

Push Tags

Push tags to remote

git push --tags
git
push
tags
git

Delete Tag

Delete a tag

git tag -d <tag>
git
tag
delete
git

List Tags

List all tags

git tag
git
tag
list
git

Manage Submodules

Initialize, update or inspect submodules

git submodule
git
submodule
repository
git

Clean Untracked Files

Remove untracked files from working tree

git clean
git
clean
files
git

Binary Search

Use binary search to find the commit that introduced a bug

git bisect
git
bisect
search
git

Manage Worktrees

Manage multiple working trees

git worktree
git
worktree
repository
git

Reference Log

Record when the tips of branches were updated

git reflog
git
reflog
history
git

Rewrite History

Rewrite branches to filter out some files or modify commits

git filter-branch
git
filter
history
git

Garbage Collection

Cleanup unnecessary files and optimize local repository

git gc
git
gc
cleanup
git

Create Patch

Prepare patches for email submission

git format-patch
git
patch
email
git

Apply Patch

Apply a series of patches from a mailbox

git am
git
patch
mailbox
git

File Annotation

Show what revision and author last modified each line of a file

git blame
git
blame
file
git

Search Code

Print lines matching a pattern

git grep
git
grep
search
git

File System Check

Verify connectivity and validity of objects in database

git fsck
git
fsck
integrity
git

Prune Objects

Prune all unreachable objects from object database

git prune
git
prune
objects
git

Show Object

Provide content or type and size information for repository objects

git cat-file
git
cat
file
git

Compute Object ID

Compute object ID and optionally create a blob from a file

git hash-object
git
hash
object