Skip to content

Instantly share code, notes, and snippets.

@ameeno
Last active August 11, 2022 22:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ameeno/d6aaa011a86e4741403fb97f028f8974 to your computer and use it in GitHub Desktop.
Save ameeno/d6aaa011a86e4741403fb97f028f8974 to your computer and use it in GitHub Desktop.
gitconfig for my bare dotfiles
[core]
repositoryformatversion = 0
filemode = true
bare = true
ignorecase = true
sshCommand = ssh -i ~/.ssh/personal_key -F /dev/null
hooksPath = ~/.dotfiles.hooks
[status]
showUntrackedFiles = no
[remote "origin"]
url = git@github.com:ameeno/dotfiles.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[status]
showUntrackedFiles = no
[user]
email = ameeno@users.noreply.github.com
name = ameeno
[alias]
update = "!f() { git commit --amend -am \"$(echo $@)\"; }; f $([ -z \"$(git status --porcelain | grep '^\\s\\?A\\s')\" ] || git status --porcelain | grep '^\\s\\?A\\s' | awk 'BEGIN{print \"Added:\"} {printf \"%s%s\",(NR>1?\", \":\"\"), $2} END{print \"\"}')" "$([ -z \"$(git status --porcelain | grep '^\\s\\?C\\s')\" ] || git status --porcelain | grep '^\\s\\?C\\s' | awk 'BEGIN{print \"Copied:\"} {printf \"%s%s\",(NR>1?\", \":\"\"), $2} END{print \"\"}')" "$([ -z \"$(git status --porcelain | grep '^\\s\\?D\\s')\" ] || git status --porcelain | grep '^\\s\\?D\\s' | awk 'BEGIN{print \"Deleted:\"} {printf \"%s%s\",(NR>1?\", \":\"\"), $2} END{print \"\"}')" "$([ -z \"$(git status --porcelain | grep '^\\s\\?M\\s')\" ] || git status --porcelain | grep '^\\s\\?M\\s' | awk 'BEGIN{print \"Modified:\"} {printf \"%s%s\",(NR>1?\", \":\"\"), $2} END{print \"\"}')" "$([ -z \"$(git status --porcelain | grep '^\\s\\?R\\s')\" ] || git status --porcelain | grep '^\\s\\?R\\s' | awk 'BEGIN{print \"Renamed:\"} {printf \"%s%s\",(NR>1?\", \":\"\"), $2} END{print \"\"}')"
# update-push = "!f() { git update && git push --force; }; f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment