Skip to content

Instantly share code, notes, and snippets.

@manisero
Last active January 24, 2023 08:28
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 manisero/1dc8c9cce46d75811883 to your computer and use it in GitHub Desktop.
Save manisero/1dc8c9cce46d75811883 to your computer and use it in GitHub Desktop.
Useful Git aliases and other options. Feel free to copy them to your "C:\Users\[user]\.gitconfig" file (Windows).
[core]
longpaths = true
[http]
sslVerify = false
[credential]
helper = manager-core
[pull]
rebase = true
[push]
default = simple
[rerere]
enabled = true
[alias]
# git:
b = branch
s = status -u .
a = add -A .
df = diff head
dfw = diff head --word-diff
c = commit -m
amend = commit --amend
pul = pull
puk = pul
pus = push
rec = rebase --continue
mec = merge --continue
co = checkout
master = checkout master
dev = checkout develop
back = checkout -
create = checkout -b
delete = branch -d
track = branch -u
ignore = update-index --assume-unchanged
unignore = update-index --no-assume-unchanged
ignored = !git ls-files -v | grep "^[[:lower:]]"
cleanSln = clean -fdx **/bin/** **/obj/**
#macros:
pullast = !git back && git pull && git back && git merge -
puslast = !git pullast && git push && git back && git merge - --no-ff && git push
pusu = !git push --set-upstream origin `git symbolic-ref --short HEAD`
memaster = !git fetch && git merge origin/master
remaster = !git fetch && git rebase origin/master
# available colors: normal, black, red, green, yellow, blue, magenta, cyan and white
# color attributes: bold, dim, ul, blink and reverse
[color "status"]
added = green bold
changed = red bold
untracked = red bold
[color "diff"]
old = red bold
new = green bold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment