[user] name = Alexis Hovorka email = alexisspacegirl@gmail.com #signingkey = [github] user = alexisspacegirl [url "https://github.com/"] insteadOf = gh: [url "https://gist.github.com/"] insteadOf = gist: [url "https://gitlab.com/"] insteadOf = gl: [url "https://bitbucket.org/"] insteadOf = bb: [url "https://aur.archlinux.org/"] insteadOf = aur: [url "git.ahov.co:"] insteadOf = ahov: [core] editor = vim excludesfile = ~/.gitignore_global [init] defaultBranch = main [commit] template = ~/.gitmessage [credential] helper = cache --timeout 3600 [merge] tool = vimdiff [push] default = simple [pull] rebase = false # ff = only #[rerere] # enabled = 1 # autoupdate = 1 #[status] # submoduleSummary = true [color] ui = true [color "branch"] current = yellow reverse local = green remote = red [color "diff"] meta = black bold frag = magenta old = red plain = white new = green whitespaces = red reverse [color "status"] added = green changed = yellow untracked = red [alias] new = "!git init && git symbolic-ref HEAD refs/heads/main" this = !bash -c 'git root &>/dev/null && echo "Already a git repository" || (git new && git add . && git commit -m \"Initial commit\")' root = rev-parse --show-toplevel cloner = clone --recursive rv = remote -v ssh = "!ssh git.ahov.co" rpush = "!f() { git remote add origin $*; git push -u origin main; }; f" h = "!f() { git log $* | grep '^commit ' | cut -d' ' -f2; }; f" # Return a list of commit SHA1s details = log -n1 -p --format=fuller # View the log and diff for a commit (previous if no SHA1 provided) churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort | awk 'BEGIN {print "count,file"} {print $1 "," $2}' hashlength = "!f() { git log --graph --topo-order --pretty='%h' $* | wc -L; }; f" namelength = "!f() { git log --pretty='%an' $* | wc -L; }; f" l = "!f() { git log --graph --topo-order --boundary --date=short --pretty=\"%>|($(git hashlength $*))%C(1)%h%Creset %C(2)%cd%Creset %<($(git namelength $*))%C(4)%an%Creset │ %s%C(16)%d%Creset\" $*; }; f" la = !git l --all ll = log --decorate --stat lp = log --patch d = diff # Current vs added dc = diff --cached # Added vs committed b = checkout -b co = checkout com = checkout master pullr = pull --rebase ra = rebase --abort rc = rebase --continue squash = rebase -i br = branch -a bv = branch -av bd = branch -d fetchp = fetch --prune fetcha = fetch --all mergef = merge --ff-only s = stash # --keep-index || -u [-a] || --patch (interactive) sl = stash list sp = stash push sd = stash drop sa = stash apply sb = stash branch poop = stash pop rmd = !git ls-files -z --deleted | xargs -0 git rm # Remove deleted files addremove = !git rmd && git add . --all # Add and remove all changes hard = reset --hard origin/master unstage = reset HEAD -- pushallmaster = !git remote | xargs -L1 -I REMOTE git push REMOTE master pushm = !git pushallmaster pushf = push --force-with-lease # safe force pushing pushfm = !git pushm --force-with-lease export = archive -o latest.tar.gz -9 --prefix=latest/ # Save a repo as a tarball; git export master amend = !git log -n 1 --pretty=tformat:%s%n%n%b | git commit -F - --amend # Same message, but include more added files trim = !git reflog expire --expire=now --all && git gc --prune=now # Thin out older metadata, reduce filesystem footprint spull = !git pull && git submodule sync --recursive && git submodule update --init --recursive sspull= !git pull && git submodule update --init --recursive --remote sfetch = submodule foreach 'git fetch --all' brlocaloneline = !git branch | grep -v \\* | xargs brdeletelocal = !git branch -D `git brlocaloneline` || echo "Nothing to delete" brallfromremotes = !git branch -a | grep 'remotes/' | grep -v "HEAD" | sed 's/remotes\\///' brcreatefromremotes = !git brallfromremotes | xargs git branch sync = !git checkout master && git brdeletelocal && git fetch --all # https://stackoverflow.com/questions/10610327/delete-all-local-git-branches#10610669