Git Config Backup
February 3, 2025
note-to-self
backup
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[user]
name =
email =
[core]
autocrlf = input
symlinks = true
excludesfile = /Users/ha/.gitignore
[alias]
# grep logs
# NOTE: searches all branches; git log --all --grep “<search>”
# NOTE: searches just that branch; git log --grep “<search>”
#
# git log --follow -- <filename> # all the commits that affect <filename>
# git log --since=“2022-04-01” # everything since a date
#
# git grep “<search>” $(git rev-list --all) # search/grep all commits/changes (not log)
# git merge -X ours/theirs <branch> # merge, but skip the "which one to keep" stuff, choose 'theirs' or 'ours'
# git diff --check # looks for conflict markers
# git diff --cached # shows you the diff for anything in `staged`
# git branch -a --contains <commit>
# git log --merges <commit>..
#
# MERGING
# Not merged:
# `git branch --no-merged` # find any branches not merged into the current branch (amazing!)
# Merged:
# `git branch --merged master` # lists branches merged into master
# `git branch --merged` # lists branches merged into HEAD (i.e. tip of current branch)
#
# git remote show origin # shows details about what branches are tracking, whether they are updated, etc (amazing!)
# git branch # List local branches
# git branch -r # List remote branches
# git branch -vv # List local branches with tracking
# git branch -r -vv # List remote branches with tracking
# git reflog --date=iso
# PRUNE
# git fetch -p
show-default = !git remote show origin| grep HEAD| sed 's/HEAD branch://'
what = !sh -c ‘git diff --stat --cached $1’ -
co = checkout
nightly = whatchanged --since=‘1 day ago’ -p
ci = commit
st = status
tag = tag -a
diffname = diff --name-status
stu = log --name-only --format=oneline ..origin/main # must fetch first; merge with git merge origin/maina
br = branch
unstage = reset HEAD --
last = log -1 HEAD
logpr = log --pretty=oneline
logwho = log --pretty=format:\"%h - %an, %ar : %s\"
changelog = log --first-parent --pretty=format:\"%ai, ‘%s’ by %an (%ae), %h\"
k = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr, %cd) %C(bold blue)<%an>%Creset%n%b'
j = log --graph --pretty=format:‘%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr, %cd) %C(bold blue)<%an>%Creset’ --abbrev-commit
conflicts = diff --check
# to get the difference between commits, do:
# > git j master..branch (git j master..search, git j staging..search) (!!! awesome!!!)
[push]
default = nothing
[branch]
autosetupmerge = true
[credential]
helper = store
UseHttpPath = true
[difftool "sourcetree"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[commit]
template = /Users/ha/.stCommitMsg
[pull]
ff = only
[safe]