[user] email = tobyv13@gmail.com name = Toby Vincent username = tobyvin signingkey = 0xA0876F29023F43AF [commit] gpgsign = true [init] defaultBranch = main [url "git@github.com:"] insteadOf = gh: pushInsteadOf = "https://github.com/" [core] editor = code --wait [diff] tool = default-difftool [difftool "default-difftool"] cmd = code --wait --diff $LOCAL $REMOTE [alias] # basic st = status -s cl = clone ci = commit co = checkout br = branch r = reset cp = cherry-pick # tweak defaults grep = grep -Ii diff = diff --word-diff branch = branch -ra ai = add --interactive # log commands lg = log --graph --oneline --decorate --all --abbrev-commit ls = log --pretty=format:"%C(green)%h\\ %C(yellow)[%ad]%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=relative ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [a:%an,c:%cn]" --decorate --numstat # undo http://megakemp.com/2016/08/25/git-undo/ undo = "!f() { git reset --soft $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; }; f" # grep on filename f = "!git ls-files | grep -i" # remove submodule smrm = "!f(){ git rm --cached \"$1\";rm -r \"$1\";git config -f .gitmodules --remove-section \"submodule.$1\";git config -f .git/config --remove-section \"submodule.$1\";git add .gitmodules; }; f" # generate git artifacts ignore = "!gi() { curl -sL https://www.toptal.com/developers/gitignore/api/$@ ;}; gi" attributes = "!ga() { curl -sL https://gist.githubusercontent.com/tobyvin/70f3671c76016063594ea45edbb97094/raw ;}; ga" # create and keep an empty directory at the provided path keep = "!gk() { ([ -f $@/.gitkeep ] || (mkdir -p $@ && curl -sL https://api.ef.gy/fortune > $@/.gitkeep)) && (grep -qsxF '!/**/.gitkeep' .gitignore || echo '!/**/.gitkeep' >> .gitignore) ;}; gk"