[user] useConfigOnly = true [push] default = simple [alias] s = status a = add ap = add -p ps = push pl = pull cl = clone cr = clone --recursive cs = clone --single-branch --depth=1 br = branch co = checkout ci = commit cm = commit -m ec = config --global --edit amend = commit -a --amend lt = log --graph --decorate --oneline --abbrev-commit --all ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat le = log --oneline --decorate dl = "!git ll -1" df = diff dfs = diff --staged dfc = diff --cached ours = "!f() { git co --ours \"$@\" && git add \"$@\"; }; f" theirs = "!f() { git co --theirs \"$@\" && git add \"$@\"; }; f" sneak = "!f() { git commit --amend --no-edit "$@" && git push -f "$@"; }; f" test = "!echo \"$@\"; echo \"$@\"" origin = remote show origin set-origin = remote set-url origin add-origin = remote add origin modpull = submodule update --remote --merge pruner = !"git prune --expire=now; git reflog expire --expire-unreachable=now --rewrite --all" repacker = !git repack -a -d -f --depth=300 --window=300 --window-memory=1g optimize = !git pruner; git repacker; git prune-packed sm = submodule # submodule remove smrm = "!f(){\ git submodule deinit -f \"$1\";\ rm -rf .git/modules/\"$1\";\ git rm -f \"$1\";\ }; f" # These are *not* good practice for collaborative projects, but are fine # for repos that use git to submit settings, where most commit messages # would be "Added "/"Removed " (I'm thinking of gitolite-admin). # Those repos are usually private and benefit from the faster commits, # while the changes are easily visible from the diff. # dated commit dcm = "!f(){ git commit -m \"$(date --iso-8601=seconds)\"; }; f" # dated push dps = "!f(){ git dcm; git push \"$@\"; }; f" # Set user information, supposed to be used once per local repo # Works better with user.useConfigOnly = true ident = "!f(){\ git config --replace-all user.name \"$1\";\ git config --replace-all user.email \"$2\";\ if [ -n \"$3\" ]; then\ git config --replace-all user.signingkey \"$3\";\ git config --replace-all commit.gpgsign true;\ fi;\ }; f" [color] ui = true