-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
114 lines (97 loc) · 3.56 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
[core]
excludesfile = ~/.gitignore
editor = vim
[init]
defaultBranch = main
[diff]
tool = vimdiff
[alias]
# Some borrowed, modified, or otherwise stolen from the following
# https://github.com/jessfraz/dotfiles/blob/master/.gitconfig
# https://github.com/mathiasbynens/dotfiles/blob/master/.gitconfig
# https://www.youtube.com/watch?v=ZDR433b0HJY
# https://gist.github.com/robmiller/6018582
# SVN-like aliases
st = status
ci = commit
br = branch
co = checkout
# Checkout a new branch
cob = checkout -b
alias=!git config -l | grep ^alias | cut -c 7- | sort
# Get the current branch name (not so useful in itself, but used in
# other aliases)
branch-name = "!git rev-parse --abbrev-ref HEAD"
# Push the current branch to the remote "origin", and set it to track
# the upstream branch
publish = "!git push -u origin $(git branch-name)"
# Delete the remote version of the current branch
unpublish = "!git push origin :$(git branch-name)"
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
# Always check for updates on remote when force pushing
pushf = push --force-with-lease
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# Stolen from Scott Chacon
lol = log --pretty=oneline --abbrev-commit --graph --decorate
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all --date=local --color
# View names of files changed in commits
logn = log --name-status --color
# View dates of the commit. with author information
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]|[%cn]" --decorate --date=short
# view times of commit with author information
lt = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]|[%cn]" --decorate --date=iso
# Extra-colorfull decorated history of commits
grog = log --graph --abbrev-commit --decorate --all --format=format:\"%C(yellow)%h%C(reset) - %C(bold cyan)%aD%C(dim blue) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(green)%d%C(reset)%n %C(white)%s%C(reset)\"
# Show verbose output about tags, branches, or remotes
tags = tag -l
branches = branch -a
remotes = remote -v
# List authors
authors = shortlog -e -s -n
# Ingnore whitespace on diff and apply
dnw = !sh -c 'git diff --ignore-space-at-eol "$@"'
anw = !sh -c 'git diff -U0 --ignore-space-at-eol --no-color "$@" | git apply --cached --unidiff-zero -'
# I really broke it. Take me back!!!
fubar = reset --hard HEAD
# Remove branches that have already been merged with master
# a.k.a. ‘delete merged’
dm = "!git branch --merged | grep -v '\\*' | xargs -n 1 git branch -d; git remote -v update -p"
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = green reverse
local = cyan
remote = blue
[color "diff"]
meta = white bold
frag = magenta bold
old = blue
new = green
[color "status"]
# added = yellow
# changed = green
# untracked = cyan
[credential]
helper = cache
[include]
# Used to override default name and email etc.
path = ~/.gitlocal
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[fetch]
prune = true
[pull]
rebase = true
[rebase]
autoStash = true
[rerere]
enabled = true
[merge]
# Include summaries of merged commits in newly created merge commit messages
log = true
[commit]
verbose = true