Skip to content

Instantly share code, notes, and snippets.

@robzienert
Last active May 4, 2021 16:32
Show Gist options
  • Save robzienert/5489306 to your computer and use it in GitHub Desktop.
Save robzienert/5489306 to your computer and use it in GitHub Desktop.
git stuffs
[color]
ui = true
[core]
excludesfile = ~/.gitignore
[alias]
cp = cherry-pick
cl = clone
ci = commit
cia = commit --all --amend
co = checkout
br = branch
dw = diff --word-diff
dc = diff --cached
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
r3 = reset HEAD^^^
rh = reset --hard
rh1 = reset --hard HEAD^
rh2 = reset --hard HEAD^^
sl = stash list
sa = stash apply
ss = stash save
standup = "!git log –since yesterday –author `git config user.email` –pretty=short"
purr = pull --rebase
st = status -sb
ready = rebase -i @{u}
wipe = reset --hard HEAD
filelog = log -u
fl = log -u
dl = "!git ll -1"
dlc = diff --cached HEAD^
la = "!git config -l | grep alias | cut -c 7-"
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
f = "!git ls-files | grep -i"
fp = push --force
pst = apply --stat
pchk = apply --check
psgn = am --signoff
nb = checkout -b
ds = diff --stat
lp = log --oneline -n 15 --graph --decorate --color
aa = add -A :/
fu = fetch upstream
pu = "!f() { git fetch upstream && git pull upstream $@; }; f"
dm = "!f() { git for-each-ref --format='%(refname:short)' refs/heads/$@ | xargs git br -D; }; f"
*.sublime-*
.DS_Store
*.pyc
# ...
function git_alias_otd() {
ALIASES=`git la`
OIFS="$IFS"
IFS="
"
ARR=( $ALIASES )
RANDOM=$$$(date +%s)
SELECTED=${ARR[$RANDOM % ${#ARR[*]}]}
echo -e "\033[1;36mGit alias OTD\033[0m"
echo -e " \033[1;33m${SELECTED}\033[0m"
IFS="$OIFS"
}
git_alias_otd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment