Skip to content

Instantly share code, notes, and snippets.

@neverendingqs
Last active October 11, 2020 22:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neverendingqs/c03e72e4c61e3c73acb8 to your computer and use it in GitHub Desktop.
Save neverendingqs/c03e72e4c61e3c73acb8 to your computer and use it in GitHub Desktop.
[user]
name = firstName lastName
email = email
[core]
preloadindex = true
fscache = true
autocrlf = false
safecrlf = false
symlinks = true
commitGraph = true
editor = code --wait
[alias]
amend = commit --amend --no-edit
brm = "!f() { git branch --merged ${1-$(git get-default-branch)} | grep -v " ${1-$(git get-default-branch)}$" | xargs -r git branch -d; }; f"
cleanup = "!git checkout $(git get-default-branch); git pull -p; git brm"
cleanupr = "!f() { find . -mindepth 1 -maxdepth 10 -type d | grep -e ".git$" | xargs -I {} bash -c 'echo {}; git -C {}/.. cleanup; echo'; }; f"
diffc = diff --cached
fixup = commit --fixup head
filediff = "!f() { echo; git diff --name-only $1; echo; }; f"
get-default-branch = !git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
historysearch = "!f() { git grep $1 $(git rev-list --all -- $2) -- $2; }; f"
ignore = update-index --assume-unchanged
lsconfig = config --list --show-origin
mergefiles = "!f() { git show HEAD:$1 > $1.ours; git show MERGE_HEAD > $1.theirs; }; f"
restage = update-index --again
sed = "!f() { git ls-files -z | xargs -0 sed -i -e ${1}; }; f"
squash = rebase -i --autosquash $(git get-default-branch)
tree = log --oneline --graph --color --all --decorate
[push]
default = current
[pull]
rebase = true
[help]
autocorrect = 20
[init]
defaultBranch = main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment