Skip to content

Instantly share code, notes, and snippets.

@nirajgiriXD
Created January 4, 2025 05:09
Show Gist options
  • Save nirajgiriXD/be84cd3f24c5ddfd6b131bfd51cb4b85 to your computer and use it in GitHub Desktop.
Save nirajgiriXD/be84cd3f24c5ddfd6b131bfd51cb4b85 to your computer and use it in GitHub Desktop.
Git short commands and their full forms

Basic Commands

gst - git status
gco - git checkout
gcb - git checkout -b
gcm - git commit
gca - git commit --amend
gaa - git add .
gap - git add -p
gcp - git cherry-pick
gcl - git clone
gl - git pull
gp - git push
gm - git merge

Branch Management

gb - git branch
gba - git branch -a
gbd - git branch -d
gbD - git branch -D

Logs and Diffs

glg - git log --graph
gl - git log
gd - git diff
gds - git diff --staged

Stashing

gsta - git stash
gstp - git stash pop
gsts - git stash show

Fetching and Pulling

gf - git fetch
gfa - git fetch --all
gup - git pull --rebase

Reset and Clean

gr - git reset
grh - git reset --hard
gclean - git clean -fd

Rebase and Squash

grb - git rebase
grbi - git rebase -i
gri - git rebase --interactive

Tagging

gt - git tag
gts - git tag -s

Remote Management

grm - git remote
grmv - git remote -v
grmr - git remote remove

Submodules

gsu - git submodule update
gsa - git submodule add
gsr - git submodule sync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment