Skip to content

Instantly share code, notes, and snippets.

@sdeering
Created January 15, 2014 14:55
Show Gist options
  • Select an option

  • Save sdeering/8437725 to your computer and use it in GitHub Desktop.

Select an option

Save sdeering/8437725 to your computer and use it in GitHub Desktop.
Some .bashrc git alias commands
#-------------------------------------------------------------
# Git Alias Commands
#-------------------------------------------------------------
alias g="git status"
alias ga="git add"
alias gaa="git add ."
alias gau="git add -u"
alias gc="git commit -m"
alias gca="git commit -am"
alias gb="git branch"
alias gbd="git branch -d"
alias gco="git checkout"
alias gcob="git checkout -b"
alias gt="git stash"
alias gta="git stash apply"
alias gm="git merge"
alias gr="git rebase"
alias gl="git log --oneline --decorate --graph"
alias glog="git log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --"
alias glga="git log --graph --oneline --all --decorate"
alias gb="git branch"
alias gs="git show"
alias gd="diff --color --color-words --abbrev"
alias gdc="git diff --cached"
alias gbl="git blame"
alias gps="git push"
alias gpl="git pull"
alias gb="git branch"
alias gc="git commit"
alias gd="git diff"
alias go="git checkout "
alias gk="gitk --all&"
alias gx="gitx --all"
# show ignored files by git
alias gx="ign = ls-files -o -i --exclude-standard"
# Untrack Files without deleting them
alias grmc="git rm -r --cached"
@Ilya-35

Ilya-35 commented Aug 31, 2021

Copy link
Copy Markdown

Thanks man it really helped me a lot!

@L1so

L1so commented Dec 26, 2021

Copy link
Copy Markdown

Thank you, I'm learning how to use git command step by step

@PhilipSchmid

Copy link
Copy Markdown

Thanks for sharing!

BTW: gd is used twice and one might also want to add alias gf="git fetch"

@guclaw

guclaw commented Mar 5, 2023

Copy link
Copy Markdown

Thanks for aliases!
gc is used twice as git commit -m and git commit

@ochi84

ochi84 commented Apr 28, 2024

Copy link
Copy Markdown

thanks, i picked some of your aliases

@ruturajv-media-net

Copy link
Copy Markdown

Never needed aliases before, "how many times am I going to execute git commands!?" was my thought, but these days of herdr and AI agents, that very arrogance has come to bite me!

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