Skip to content

Instantly share code, notes, and snippets.

@keklikhasan
Last active October 16, 2022 10:33
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save keklikhasan/8b6378d26db5e2d95a82 to your computer and use it in GitHub Desktop.
[user]
email = keklikhasan@gmail.com
name = Hasan Keklik
[core]
autocrlf = input
excludesfile = /Users/h.keklik/.gitignore_global
[color]
diff = auto
status = auto
branch = auto
[svn]
followparent = true
[branch]
autosetuprebase = always
# Show a log of '56 minutes ago' rather than 'November 12, 2008 12:34:53'
[log]
date = relative
[alias]
co = checkout
st = status
ec = config --global -e
br = branch -vv
ls = !git branch -r && git br
fe = !git fetch && git br
cob = checkout origin/HEAD -b
subinit = submodule update --init --recursive
subupdate = submodule update --recursive --remote
# rename branch
rn = "!f(){ git branch -m ${1}; };f"
r = rm --cached
cm = !git add -A && git commit -m
em = commit --allow-empty -m
emc = commit --allow-empty -m 'trigger ci'
save = !git add -A && git commit -m 'SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = "!f(){ git reset --soft HEAD~${1}; };f"
amend = commit -a --amend
tr = "!f(){ git branch -u origin/${1} && git br; };f"
trm = !git branch -u origin/HEAD && git br
trb = "!f(){ branch="$(git symbolic-ref HEAD 2>/dev/null)" && branch=${branch##refs/heads/} && git branch -u origin/$branch && git br; };f"
# set default branch
defaultb = "!f(){ git remote set-head origin ${1}; };f"
# delete branch from local
dlb = "!f(){ git branch -D ${1}; };f"
# delete tag from remote
dt = "!f(){ git tag -d ${1} && git push origin :refs/tags/${1}; };f"
wipe = !git add -A && git commit -qm 'WIPE SAVEPOINT' && git reset HEAD~1 --hard
bclean = "!f() { git branch --no-track --no-color --merged ${1-dev} | grep -v " ${1-dev}$" | xargs -r git branch -d; }; f"
bdone = "!f() { git checkout ${1-dev} && git up && git bclean ${1-dev}; }; f"
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
cp = cherry-pick
lg = log --oneline
lgv = "!f(){ git log --pretty=oneline ${1}..; };f"
plus = commit --amend -a -C HEAD
#old task = "!f() { git fetch; task=$1; shift; desc="${@}"; desc=${desc// /_}; desc=${desc//-/_}; desc=${desc//:/}; git cob "${task}_${desc}"; }; f"
task = "!f() { git fetch; desc="${@}"; desc=${desc//:/-}; desc=${desc// /-}; desc=${desc//---/-}; desc=${desc//--/-}; git rn ${desc}; }; f"
trn = "!f() { message=$(git log -1 --pretty=%B); git task $message; }; f"
stask = "!f() { git save; git task ${@}; }; f"
[pull]
rebase = true
[pager]
branch = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment