1
Fork 0

git: create alias for other useful commands previously moved to wiki

This commit is contained in:
Alan Faubert 2018-09-24 22:08:49 -04:00
parent dc81b172d9
commit d19a318a1a
2 changed files with 8 additions and 0 deletions

View File

@ -1,4 +1,8 @@
[alias]
clean-branches = !git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -d
clean-committer-date = filter-branch --env-filter 'GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE' --
clean-original = !git show-ref | grep ' refs/original/' | cut -d ' ' -f 2 | xargs -n 1 git update-ref -d
turbo-gc = -c gc.reflogExpire=0 -c gc.reflogExpireUnreachable=0 -c gc.rerereresolved=0 -c gc.rerereunresolved=0 -c gc.pruneExpire=now gc
unfilemode = config --unset-all core.filemode
user-acf = !git config --replace-all user.email 'git@acf.ws' && git config --replace-all user.name 'Alan Faubert'
user-conv = !git config --replace-all user.email 'git@chor.date' && git config --replace-all user.name 'Conduitry'

View File

@ -2,5 +2,9 @@
This `.gitconfig` does not include a default identity for commits. It does define a few aliases though:
- `git clean-branches` - delete local branches that track remote branches that have been deleted
- `git clean-committer-date` - set all committer dates of all commits in the given range to their author dates
- `git clean-original` - delete all `refs/original/` refs left by `git filter-branch`
- `git turbo-gc` - turbo garbage collect, wipe reflog, everything
- `git unfilemode` - unset `core.filemode` on this repo, so global (`core.filemode = false`) will be used
- `git user-*` - set `user.email` and `user.name` as appropriate