1
Fork 0

git: add clean-permissions alias

This commit is contained in:
Alan Faubert 2018-09-25 10:30:05 -04:00
parent d19a318a1a
commit 8385b7f30a
2 changed files with 2 additions and 0 deletions

View File

@ -2,6 +2,7 @@
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
clean-permissions = !git -c core.filemode diff -R | grep -E '^(diff|(old|new) mode)' | git apply
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'

View File

@ -5,6 +5,7 @@ This `.gitconfig` does not include a default identity for commits. It does defin
- `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 clean-permissions` - reset all file permissions to to those according to the repository
- `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