-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitconfig
92 lines (73 loc) · 2.81 KB
/
.gitconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
[alias]
# View the SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph
# View the current working tree status using the short format
s = status -s
st = "unpushed; status"
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git diff --patch-with-stat"
# `git di $number` shows the diff between the state `$number` revisions ago and the current state
di = !"d() { git diff --patch-with-stat HEAD~$1; }; git diff-index --quiet HEAD -- || clear; d"
# list git log in one line format
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
# Pull in remote changes for the current repository and all its submodules
p = !"git pull; git submodule foreach git pull origin master"
# Commit all changes
cm = !git add -A && git commit -m
# Switch to a branch, creating it if necessary
go = checkout -B
# Show verbose output about tags, branches or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# Credit an author on the latest commit
credit = "!f() { git commit --amend --author \"$1 <$2>\" -C HEAD; }; f"
# Interactive rebase with the given number of latest commits
reb = "!r() { git rebase -i HEAD~$1; }; r"
# Undo a `git push`
undopush = push -f origin HEAD^:master
# Get the number of unpushed commits
unpushed = !GIT_CURRENT_BRANCH=$(git name-rev --name-only HEAD) && git log origin/$GIT_CURRENT_BRANCH..$GIT_CURRENT_BRANCH --oneline
# remove all local branches, minus the current one and development
cleanlocal = !"git branch | grep -v ^* | grep -v development | xargs git branch -d"
# remove all remote branches, minus the current one and development
cleanorigin = !"git branch | grep -v ^* | grep -v development | xargs git push --delete origin"
# find a file by name
find = !"git ls-files | grep -i"
# clear uncommited changes
cleanout = !"git checkout -- ."
br = "!create_upstream_branch() { git fetch upstream && git checkout upstream/development && git checkout -b $1; }; create_upstream_branch"
[core]
# Use custom `.gitignore`
excludesfile = ~/.gitignore
[color]
# Use colors in Git commands that are capable of colored output when outputting to the terminal
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "diff"]
meta = yellow bold
frag = magenta bold
old = red bold
new = green bold
[color "status"]
added = yellow
changed = green
untracked = cyan
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
[user]
name = Grant Klinsing
email = klingra@chrobinson.com
[mergetool]
keepBackup = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[pull]
rebase = false