Skip to content

Instantly share code, notes, and snippets.

@GarySmith
Created June 21, 2018 19:38
Show Gist options
  • Save GarySmith/d65b5ecb04eb5ee704a43db464ed38cc to your computer and use it in GitHub Desktop.
Save GarySmith/d65b5ecb04eb5ee704a43db464ed38cc to your computer and use it in GitHub Desktop.
[user]
name = Gary Smith
email = gary.smith@suse.com
[core]
editor = vim
excludesfile = ~/.gitignore
#pager = less -X
# As of git 2.9, git will look in hooksPath for hooks instead of .git/hooks
hooksPath = ~/.githooks
[merge]
# tool = meld
tool = vimdiff
# Use 'git merge' without any arguments to perform a normal ff merge
# of the corresponding remote branch, like what git pull does. This
# enables using git fetch, then checkout any local branch and git merge
defaultToUpstream = true
[difftool]
# If tool exits with non-zero value, then stop diffing files
trustExitCode = true
prompt = false
[diff]
tool = vimdiff
#guitool = gvimdiff
# guitool = meld
#
renames = copy
compactionHeuristic = true
[grep]
extendedRegexp = true
[alias]
st = status -s
co = checkout
cp = cherry-pick
br = branch
bra = branch -a
cob = checkout -b
# show all remotes, without hitting any remote servers
remotes = remote -v show -n
# Remove branches for reviews or pull requests, which can always be recreated by re-fetching
brd = !git branch --list 'review/*' 'pr/*' | xargs -r git br -D
# Show branches along with their upstream sources
brvv = branch -vv
# Log with brief status msg
logs = log --stat
# "Bare" log with no merges, which is useful with gerrit
logb = log --no-merges --format=colornotags
# "full" log
logf = log --format=full
ls = ls-files
# Display info like SVN
logsvn = log --name-status
svnlog = log --name-status
# Display the diffs with each commit
logdiff = log -U
# Display the file names that changed
diffn = diff --name-status
# Show the full content of the change
showl = show --format=full
# Use git show <commit> to display the diff of the given commit
# remove files from index
unstage = reset HEAD
# uncommit the last commit, leaving files staged
uncommit = reset --soft HEAD^
# reset to upstream
resetu = reset --hard @{u}
# amend the last commit with the outstanding changes without prompting for a new message
amend = commit --amend --no-edit
# use tig for reflog -- even better!
rlog = !git reflog --pretty=raw | tig --pretty=raw
# list aliases
aliases = ! git config --global --get-regexp alias | sort
# github alias for downloading and removing a pull request
pr = "!f() { git fetch -fu ${2:-$(git remote |grep ^upstream || echo origin)} refs/pull/$1/head:pr/$1 && git checkout pr/$1; }; f"
# ^ See brd for a much simpler implementation
# Manually regenerate ctags. Note that this is normally done automatically via git hooks
ctags = ! ~/.githooks/ctags
[format]
# Make 'git log' default to this format
pretty = color
[pretty]
color = %C(red)%h %C(green)%ad %C(blue)%<(18,trunc)%aN %C(reset)%s%C(yellow)%d
# Print in color with a posix commit date, which is what ibs/obs uses
obs = %C(red)%h %C(green)%ct %C(blue)%<(18,trunc)%aN %C(reset)%s%C(yellow)%d
# Some repos have just TOO many useless tags
colornotags = %C(red)%h %C(green)%ad %C(blue)%<(18,trunc)%aN %C(reset)%s
# Useful for printing the reflog with 'git rlog', aka. 'git log -g --format=reflog'
reflog = %gd AFTER: %C(bold red)%gs%Creset%n %C(red)%h %C(green)%ad %C(blue)%<(18,trunc)%aN%C(yellow)%d %C(reset)%s%n
[log]
# default date format for log command
date = short
[color]
ui = true
review = true # Tell git-review to use colors in its output
showBranch = always
[color "branch"]
current = yellow
remote = green
[color "status"]
added = yellow
changed = green
untracked = cyan
[help]
format = web
autocorrect = -1 # execute spell-corrected command immediately
[web]
browser = google-chrome
[rebase]
# If commit msg starts with squash!, the rebase -i should honor it
autosquash = true
# If the local tree is dirty, stash changes first and re-apply them at the end
autoStash = true
[clean]
requireForce = false
[apply]
whitespace = nowarn
[mailmap]
file = /home/gary/.gitmailmap
[push]
default = upstream
[pull]
rebase = preserve
# avoid creating merge commits when pulling
ff = only
# for the optional git-send-email command
[sendemail]
suppresscc = all
smtpserver = smtp.novell.com
[http]
sslVerify = false
[pager]
# Use a fancy way of displaying diffs
log = diff-so-fancy | less
show = diff-so-fancy | less
diff = diff-so-fancy | less
[github]
user = garysmith123@gmail.com
password = MYPASSWORD
[pager]
# Avoid using a pager with the output of the git branch command
branch = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment