Created
August 3, 2017 18:43
-
-
Save kukiron/2238775bb6c9b6034cf3dc92f6aca2c5 to your computer and use it in GitHub Desktop.
List of Git Aliases in .bashrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# one-line log | |
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short | |
a = add | |
ap = add -p | |
c = commit --verbose | |
ca = commit -a --verbose | |
cm = commit -m | |
cam = commit -a -m | |
m = commit --amend --verbose | |
d = diff | |
ds = diff --stat | |
dc = diff --cached | |
s = status -s | |
co = checkout | |
cob = checkout -b | |
# list branches sorted by last modified | |
b = "!git for-each-ref --sort='-authordate' --format='%(authordate)%09%(objectname:short)%09%(refname)' refs/heads | sed -e 's-refs/heads/--'" | |
# list aliases | |
la = "!git config -l | grep alias | cut -c 7-" | |
rao = remote add origin | |
ac = !git add . && git commit -am | |
pushitgood = push -u origin --all | |
undo-commit = reset --soft HEAD~1 | |
com=checkout master | |
st="tash | |
stl=stash list | |
rl=ref log | |
g = commit --verbose --patch | |
new = checkout -b | |
up = submodule update --init --recursive --remote | |
wdiff = diff --word-diff | |
brd = !sh -c \"git checkout master && git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d\" | |
brdhere = !sh -c \"git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d\" | |
diffst = diff --name-only | |
pullf = !sh -c \"git reset --hard origin/$(git rev-parse --abbrev-ref HEAD)\" | |
amend = commit --amend -C HEAD | |
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment