Skip to content

Instantly share code, notes, and snippets.

@bcawrse
Last active Oct 18, 2021
Embed
What would you like to do?
# Set the editor to vim.. duh
git config --global core.editor vim
# Add aliases
git config --global alias.logthis 'log --decorate --date-order --graph --tags HEAD'
git config --global alias.logall 'log --decorate --date-order --remotes --graph --tags --branches'
git config --global alias.logalls 'log --decorate --date-order --remotes --graph --tags --branches --stat'
git config --global alias.diffc 'diff --cached'
git config --global alias.count 'count-objects -vH'
git config --global alias.package '"!f() { git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $1..HEAD; }; f"'
git config --global alias.packaged '"!f() { mkdir -p \"$(git root)/$2\" && git package $1 | xargs cp --parents -t $2; }; f"'
git config --global alias.root '"!f() { echo $(git rev-parse --show-toplevel); }; f"'
git config --global alias.packfrom "!f() { git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT $1..$2; }; f"
git config --global alias.packedfrom "!f() { mkdir -p \"$(git root)/$3\" && git packfrom $1 $2 | xargs cp --parents -t $3; }; f"
git config --global alias.conflicts 'diff --name-only --diff-filter=U'
git config --global alias.rm-deleted "!f() { git ls-files --deleted -z | xargs -r0 git rm; }; f"
git config --global alias.add-rm "!f() { git ls-files --dleted -z | xargs -r0 git rm; }; f"
git config --global alias.add-new "!f() { git add $(git ls-files -o --exclude-standard); }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment