Skip to content

Instantly share code, notes, and snippets.

@andycole
Last active January 11, 2023 09:26
Show Gist options
  • Save andycole/5927625 to your computer and use it in GitHub Desktop.
Save andycole/5927625 to your computer and use it in GitHub Desktop.
My git config
## Basic colours
[color]
branch = auto
diff = auto
status = auto
interactive = auto
ui = auto
[color "branch"]
current = yellow bold
local = white
remote = white
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = green bold
changed = yellow bold
untracked = red bold
[color "interactive"]
error = red
prompt = yellow
header = normal
help = green
[user]
name = Andy Cole
email = andy.cole@videogamer.com
[alias]
co = checkout
ct = commit
addp = -c color.ui=true add -p
addi = -c color.ui=true add -i
## Less verbose status
st = status -sb
## Run diff on already staged files
ds = diff --staged
## Add newly staged files to last commit
amend = commit --amend -C HEAD
## Revert last local commit
undo = reset --soft HEAD^
## Nicer less verbose git log
lg = log --pretty=format:'%C(yellow)%h %C(magenta)%ad%C(red)%d %C(reset)%s%C(green) [%cn]' --decorate --date=short
## Show commits by me yesterday
standup = log --since '1 day ago' --oneline --author andy.cole@videogamer.com
## Visualise a git log on a timeline
graph = log --graph --pretty=format':%C(yellow)%h%Cblue%d%Creset %s %C(white) %an, %ar%Creset'
## Revert an applied stash (re-stash)
stash-unapply = !git stash show -p | git apply -R
## Keep a file in the repo but ignore local changes (add/remove/list)
assume = update-index --assume-unchanged
unassume = update-index --no-assume-unchanged
assumed = "!git ls-files -v | grep ^h | cut -c 3-"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment