-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.gitconfig
More file actions
98 lines (92 loc) · 3.25 KB
/
.gitconfig
File metadata and controls
98 lines (92 loc) · 3.25 KB
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
[core]
excludesfile = ~/.gitignore_global
[web]
browser = firefox
[apply]
# Detect whitespace errors when applying a patch
whitespace = fix
[alias]
# https://git.wiki.kernel.org/index.php/Aliases
s = status -sb
cm = commit
c = !git add . && git commit -a && git push
fuck = !git commit --amend && git push --force
br = branch
co = checkout
d = diff
up = !git fetch origin && git rebase origin/master
ir = !git rebase -i origin/master
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
who = shortlog -s -n --
go = checkout -B
lg = log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
standup = log --pretty=format:'%Cred%h%Creset -%Creset %s %Cgreen(%cD) %C(bold blue)<%an>%Creset' --since yesterday --author joe
purr = pull --rebase
# usage example: git w -n5
w = whatchanged
# add all changed (but not new) files to stage (index):
au = add -u
# show conflicting merge in gitk:
gitkconflict = !gitk --left-right HEAD...MERGE_HEAD
# prune all tracking local branches that have been removed from remote:
prune-all = !git remote | xargs -n 1 git remote prune
# show full history in gitk (including "deleted" branches and stashes)
history-all = !gitk --all $( git fsck | awk '/dangling commit/ {print $3}' )
# given a string for an author, try to figure out full name and email:
whois = "!sh -c 'git log -i -1 --pretty=\"format:%an <%ae>\n\" --author=\"$1\"' -"
# given any git object, try to show it briefly
whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short
# Search for a given string in all patches and print commit messages
# example: search for any commit that adds or removes string "foobar"
# git searchcommits foobar
# example: search commits for string "foobar" in directory src/lib
# git searchcommits foobar src/lib
# example: search commits for "foobar", print full diff of commit with 1 line context
# git searchcommits foobar --pickaxe-all -U1 src/lib
searchcommits = "!f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\""
# slight ego-boosting
# show list of contributors in descending order by number of commits
rank = shortlog -sn --no-merges
rank-with-merges = shortlog -sn
[rerere]
enabled = 1
[branch]
autosetuprebase = always
[color]
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]
log = true
# Use `origin` as the default remote on the `master` branch in all cases
[branch "master"]
remote = origin
merge = refs/heads/master
# URL shorthands
[url "git@github.com:"]
insteadOf = "gh:"
pushInsteadOf = "github:"
pushInsteadOf = "git://github.com/"
[url "git://github.com/"]
insteadOf = "github:"
[url "git@gist.github.com:"]
insteadOf = "gst:"
pushInsteadOf = "gist:"
pushInsteadOf = "git://gist.github.com/"
[push]
default = tracking
[user]
email = contact@gaurishsharma.com
name = Gaurish Sharma
editor = vim