Skip to content

Instantly share code, notes, and snippets.

@ismail1432
Created October 17, 2018 08:26
Show Gist options
  • Save ismail1432/1c84106fffe5487df4cce4b680f00955 to your computer and use it in GitHub Desktop.
Save ismail1432/1c84106fffe5487df4cce4b680f00955 to your computer and use it in GitHub Desktop.
st = status
co = checkout
cob = checkout --no-track -b
cp = cherry-pick
rb = rebase
rbom = rebase origin/master
rbi = rebase -i
rbiom = rebase -i origin/master
c = commit
ca = commit --amend
can = commit --amend --no-edit
com = commit -m
coma = commit -a -m
aa = add --all
fa = fetch --all -p -v
f = fetch --all -p
r1 = reset HEAD~1
# push
p = push
poh = push -u origin HEAD # like first push
pf = push --force-with-lease
# log section
l = !git log | tig -FRSX
ll = log --color --all --format='%C(yellow)%h%Creset %cr %C(blue)%cn%Creset -%C(auto)%d%Creset %s'
lg = log --graph --oneline --abbrev-commit --color --decorate
lgt = log --graph --oneline --abbrev-commit --color --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'
lga = log --graph --oneline --abbrev-commit --color --decorate --all
# branch management
bdelete-force = !git branch --no-color | grep -v '*' | grep -v master | xargs --no-run-if-empty git branch -D
bdelete = !git branch --no-color --merged | grep -v '*' | grep -v master | xargs --no-run-if-empty git branch -d
bm = branch -m
recent = for-each-ref --count=10 --sort=-committerdate refs/heads/ --format="%(refname:short)"
# alias management
aliases = "!git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\t=> \\2/' | sort"
# diff
d = diff
dc = diff --cached
dw = diff -w
dwc = diff -w --cached
da = difftool -d
daw = difftool -d -w
dac = difftool -d --cached
dawc = difftool -d --cached -w
# tags
tdelete = fetch --prune origin +refs/tags/*:refs/tags/*
last-tag = describe --abbrev=0 --tags
@ismail1432
Copy link
Author

ismail1432 commented Oct 17, 2018

Git aliases list gave me by my man https://github.com/B-Galati

open git config
vim .~/.gitconfig
copy/paste the bottom list under the alias section [alias]

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