[user] name = Aron, Michal email = aronmgv@gmail.com [core] eol = lf autocrlf = false longpaths = true excludesfile = ./.gitignore editor = nano [init] defaultBranch = master [credential] helper = /usr/local/share/gcm-core/git-credential-manager-core [http] #proxy = [merge] tool = diffuse [rebase] autosquash = true [alias] # test function test = "!f() { echo ${@:3:2}; }; f" test2 = "!f() { echo $(git config init.defaultBranch); }; f" # list all aliases alias = "!git config --get-regexp ^alias\\. | sed -e 's/^alias\\.\\([^ ]*\\)/\\x1B[33m\\1\\x1B[0m =/' | grep -v 's/^alias'" # edit config ec = "config --global -e" # exec alias exec = "!exec " # remote prune rpo = "remote prune origin" # remove untracked files from the working tree cutr = "clean -fdx" # cleanup unnecessary files and optimize the local repository gcp = "gc --prune=now" # root root = "rev-parse --show-toplevel" # checkout co = "checkout" # checkout master branch com = "checkout master" # checkout last branch col = "checkout -" # checkout new branch cob = "checkout -b" # adds all changes including untracked files and perform the commit cm = "!git add -A && git commit -m " # pull and rebase master into curent branch prm = "pull --rebase origin master" # pull and rebase given branch into curent branch prb = "pull --rebase origin" # assume unchanged / undo assume unchanged au = "!git update-index --assume-unchanged" uau = "!git update-index --no-assume-unchanged" # checkpoint of tracked changes only in working directory wip = "commit -am 'WIP'" wipp = "!git au package.json package-lock.json && git commit -am 'WIP-A' && git uau package.json package-lock.json" # checkpoint of all changes in working directory save = "!git add -A && git commit -m 'CHECKPOINT'" # reset previous commit and keep changes # --soft: uncommit changes, changes are left staged (index). # --mixed: uncommit + unstage changes, changes are left in working tree. # --hard: uncommit + unstage + delete changes, nothing left. unwipm = "reset --mixed HEAD^" unwiph = "reset --hard HEAD^" unwip = "reset --soft HEAD^" unwipp = "reset --soft HEAD^^" unwippp = "reset --soft HEAD^^^" unwipppp = "reset --soft HEAD^^^^" unwippppp = "reset --soft HEAD^^^^^" # drop uncommited and reset to master drm = "reset --hard origin/master" # reword last commit message amend = "commit -a --amend" # rename local and remote branch name brename = "!f() { old_name=$(git rev-parse --abbrev-ref HEAD); new_name=${@:1:1}; git branch -m $old_name $new_name; git push origin --delete $old_name; git branch --unset-upstream $new_name; git push origin $new_name; git push origin -u $new_name; }; f" # pretty log plog = "log --decorate --abbrev-commit --date=relative --pretty=format:'%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%ad %C(auto,green)%aN%C(auto,reset) %s%C(auto,red)% gD% D'" glog = "log --graph --decorate --abbrev-commit --date=relative --pretty=format:'%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%ad %C(auto,green)%aN%C(auto,reset) %s%C(auto,red)% gD% D'" #plog = log --graph --decorate --pretty=oneline --abbrev-commit #plog = log --graph --decorate --abbrev-commit --date=relative --pretty=format:'%C(auto,yellow)%h%C(auto,magenta)% G? %C(auto,blue)%>(12,trunc)%ad %C(auto,green)%aN%C(auto,reset) %s%C(auto,red)% gD% D' # full sync with origin (needs to be master) up = "!git pull --rebase --prune $@ && git submodule update --init --recursive" # clean all branches already merged into master bclean = "!f() { git checkout ${1-master} && git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f" # finish work on brnach (up & bclean) bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f" # use git fixup COMMIT to change a specific "COMMIT" fixup = "!f() { TARGET=$(git rev-parse "$1"); git commit --fixup=$TARGET ${@:2} && EDITOR=true git rebase -i --autostash --autosquash $TARGET^; }; f" # assume-unchanged package.json and package-lock.json aup = "!git au package.json package-lock.json" uaup = "!git uau package.json package-lock.json" [filter "lfs"] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process required = true [safe] directory = *