Skip to content

Instantly share code, notes, and snippets.

@Vladnev
Last active October 6, 2023 09:30
Show Gist options
  • Save Vladnev/f8d0e576523836d9c14715ff36f5c150 to your computer and use it in GitHub Desktop.
Save Vladnev/f8d0e576523836d9c14715ff36f5c150 to your computer and use it in GitHub Desktop.
Git configuration file
[user]
name = <NAME>
email = <EMAIL>
[alias]
go = checkout
co = "commit -m"
co-name = "!git add --all | git commit -m \"$(git branch-name)\""
do = checkout -b
to = push origin
amend = commit --amend --no-edit
cfm = !git cherry -v master | wc -l
whoops = "!git reset --keep HEAD@{1}"
branch-name = "!git rev-parse --abbrev-ref HEAD"
publish = "!git push -u origin $(git branch-name)"
publishf = "!git push -u origin $(git branch-name) --force-with-lease"
unpublish = "!git push origin :$(git branch-name)"
wip = !git add --all && git commit -m "[wip]"
unwip = !git log -n 1 | grep -q -c "[wip]" && git reset HEAD~1
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
squash = "!f(){ git reset --soft HEAD~$1 && git commit ${2:+-m \"$2\"}; };f"
delete-merged-branches = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d"
alldone = "!git checkout $(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5) && git branch -D @{-1}"
[merge]
tool = vimdiff
[core]
excludesfile = <PATH_TO_GITIGNORE>
ignorecase = true
autocrlf = input
editor = vi
[push]
default = matching
[oh-my-zsh]
hide-dirty = 1
[pull]
rebase = true
[fetch]
prune = true
[pager]
branch = false
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment