Linux Terminal Glossary
›
Git - Core
Git - Core
232 commands
git init
git init myproject
git clone https://github.com/user/repo.git
git clone --depth 1 https://github.com/user/repo.git
git clone -b main https://github.com/user/repo.git
git status
git status -s
git add file.txt
git add .
git add -A
git add -p
git add -u
git commit -m 'message'
git commit -am 'message'
git commit --amend
git commit --amend --no-edit
git commit --allow-empty -m 'trigger CI'
git push origin main
git push -u origin main
git push --force-with-lease
git push origin --delete feature-branch
git push --tags
git pull
git pull --rebase
git pull origin main
git fetch
git fetch origin
git fetch --all
git fetch --prune
git branch
git branch -a
git branch -r
git branch feature-xyz
git branch -m old-name new-name
git branch -d feature-xyz
git branch -D feature-xyz
git checkout feature-xyz
git checkout -b feature-xyz
git checkout -- file.txt
git switch main
git switch -c feature-xyz
git restore file.txt
git restore --staged file.txt
git merge feature-xyz
git merge --no-ff feature-xyz
git merge --squash feature-xyz
git merge --abort
git rebase main
git rebase -i HEAD~3
git rebase --onto main feature base
git rebase --abort
git rebase --continue
git stash
git stash push -m 'WIP: feature'
git stash pop
git stash apply stash@{2}
git stash list
git stash drop stash@{0}
git stash clear
git stash branch feature-xyz stash@{0}
git log
git log --oneline
git log --oneline --graph --all
git log -p
git log -n 10
git log --author='Alice'
git log --since='2 weeks ago'
git log --grep='bugfix'
git log -- file.txt
git diff
git diff --staged
git diff main feature
git diff HEAD~1 HEAD
git show abc1234
git show HEAD:file.txt
git tag v1.0.0
git tag -a v1.0.0 -m 'Release 1.0.0'
git tag -d v1.0.0
git remote -v
git remote add origin https://github.com/user/repo.git
git remote set-url origin https://github.com/user/repo.git
git remote remove origin
git config user.name 'Your Name'
git config user.email 'you@example.com'
git config --global core.editor vim
git blame file.txt
git blame -L 10,20 file.txt
git bisect start
git bisect good abc1234
git bisect bad HEAD
git bisect reset
git cherry-pick abc1234
git cherry-pick abc1234..def5678
git reset --soft HEAD~1
git reset --mixed HEAD~1
git reset --hard HEAD~1
git revert abc1234
git revert HEAD
git clean -fd
git clean -n
git archive --format=zip HEAD > archive.zip
git init --bare myrepo.git
git clone --mirror https://github.com/expressjs/express.git
git clone --recurse-submodules https://github.com/emscripten-core/emscripten.git
git clone --shallow-since=2024-01-01 https://github.com/expressjs/express.git
git clone --filter=blob:none https://github.com/expressjs/express.git
git clone --single-branch --branch v5.1.0 https://github.com/expressjs/express.git
git status --short --branch
git status --porcelain
git status --ignored
git diff --stat
git diff --numstat
git diff --name-only
git diff --word-diff
git diff --check
git diff HEAD~1 -- src/app.js
git diff --no-index a.txt b.txt
git add -N file.txt
git add -e file.txt
git add --dry-run .
git add --chmod=+x deploy.sh
git commit --author='Alice Smith <alice@example.com>' -m 'Refactor auth flow'
git commit --squash HEAD~1
git commit --date='2024-01-15 10:30'
git commit --no-verify -m 'skip hooks'
git commit -v
git commit -F changelog-entry.md
git commit --amend --author='Carol <carol@example.com>'
git log --oneline -10
git log --graph --oneline --all --decorate
git log -S 'calculate_total' --oneline
git log -G 'password\s*=' --oneline
git log --author='Alice' --oneline
git log --follow -- README.md
git log --stat
git log --merges --oneline
git log --no-merges --oneline
git log --first-parent --oneline
git log --format='%h %an %s'
git log --until='2024-03-01' --oneline
git log --diff-filter=M --oneline
git log -L 40,60:src/main.rs
git show HEAD
git show HEAD~1:src/app.js
git show --stat HEAD
git cat-file -p HEAD
git rev-parse HEAD
git rev-parse --abbrev-ref HEAD
git rev-parse --short HEAD
git rev-list --count HEAD
git blame server.py --date short
git blame -w app.js
git shortlog -sne
git grep 'TODO'
git grep -n 'apiKey' -- '*.js'
git grep -l 'FIXME'
git stash push --keep-index
git stash push -u -m 'wip: draft layout'
git stash show -p stash@{0}
git stash apply
git branch -vv
git branch --merged
git branch --no-merged
git branch --show-current
git branch --list 'feature/*'
git branch --set-upstream-to=origin/main main
git branch --contains v1.0.0
git branch --sort=-committerdate
git branch -dr origin/feature-x
git switch -
git switch --detach v1.0.0
git switch --orphan gh-pages
git restore --source=HEAD~1 src/app.js
git restore --staged --worktree file.txt
git restore --staged .
git checkout -- .
git checkout -t origin/feature-notifications
git checkout -p src/app.js
git merge --ff-only origin/main
git merge --continue
git merge --no-commit feature-xyz
git rebase --skip
git rebase --autostash main
git reset HEAD file.txt
git rm file.txt
git rm --cached file.txt
git rm -r old-assets/
git mv old-name.txt new-name.txt
git clean -fdX
git tag -l 'v1.*'
git tag -f v1.0.0 abc1234
git push origin v1.0.0
git push origin :refs/tags/v1.0.0
git config --global user.name 'Alice Smith'
git config --global user.email 'alice@example.com'
git config --global init.defaultBranch main
git config --global alias.co checkout
git config --global alias.lg "log --oneline --graph --all"
git config --global core.editor code --wait
git config --list
git config --get remote.origin.url
git config --global credential.helper store
git config --global core.autocrlf input
git config --global color.ui auto
git config --global pull.rebase true
git remote add upstream https://github.com/expressjs/express.git
git remote rename origin upstream
git remote show origin
git remote prune origin
git remote get-url origin
git fetch origin feature-branch
git fetch --tags
git pull --rebase origin main
git pull --ff-only
git pull --autostash
git push --dry-run origin main
git push origin main --follow-tags
git push --all origin
git submodule status
git submodule deinit -f libs/lib
git archive --format=zip --prefix=myapp/ HEAD -o myapp.zip
git count-objects -vH
git gc --auto
git maintenance run --auto
git fsck --full
git check-ignore .env
git ls-tree -r HEAD --name-only
git describe --abbrev=0
git version
git show-ref --heads
git difftool HEAD~1 HEAD -- src/app.js
git mergetool
Search all 7,657 commands
instead.