-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitconfig
139 lines (101 loc) · 3.34 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
[user]
#name = your name
#email = your email
[core]
editor=vim
[merge]
tool=vimdiff
[mergetool]
prompt=false
[alias]
# Thanks to
# https://github.com/SixArm/sixarm_git_gitconfig/blob/master/gitconfig.d/alias.txt
##########
# add - record file contents to the index.
a = add
# add by patch - looks at each change, and asks if we want to put it in the repo.
ap = add --patch
##########
# branch - list, create, or delete branches.
br = branch
##########
# commit - record changes to the repostiory.
cm = commit
##########
# diff - show changes between commits, commit and working tree, etc.
d = diff
# diff - show changes not yet staged
dc = diff --cached
# diff - changes about to be commited
ds = diff --staged
##########
# fetch - download objects and refs from another repository.
f = fetch
##########
# grep - print lines matching a pattern.
g = grep
##########
# log - show commit logs.
l = log
# log with a text-based graphical representation of the commit history.
lg = log --graph
# log with one line per item.
lo = log --oneline
##########
# merge - join two or more development histories together.
m = merge
##########
# checkout - update the working tree to match a branch or paths; we use "o" to mean "out".
co = checkout
##########
# pull - fetch from and merge with another repository or a local branch.
p = pull
##########
# pull with rebase - to provide a cleaner, linear, bisectable history.
pr = pull --rebase
##########
# remote - manage set of tracked repositories.
r = remote
##########
# status - show the working tree differences. (Expert users may prefer: status -sb)
st = status
##########
# rebase - forward-port local commits to the updated upstream head.
rb = rebase
##########
# rebase - interactive
rbi = rebase -i
# rebase - continue the rebasing process after resolving a conflict manually and updating the index with the resolution.
rbc = rebase --continue
# rebase - restart the rebasing process by skipping the current patch.
rbs = rebase --skip
##########
# cherry-pick - apply the changes introduced by some existing commits; useful for moving small chunks of code between branches.
cp = cherry-pick
##########
# ls-files - show information about files in the index and the working tree; like Unix "ls" command.
ls = ls-files
# ls-ignored - list files that git has ignored.
ls-ignored = ls-files --others --i --exclude-standard
##########
# Show our defined aliases
aliases = !"git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'"
##########
# Show our tags
tags = tag -n1 -l
# Stash snapshot - from http://blog.apiaxle.com/post/handy-git-tips-to-stop-you-getting-fired/
# Take a snapshot of your current working tree without removing changes.
# This is handy for refactoring where you can’t quite fit what you’ve done
# into a commit but daren’t stray too far from now without a backup.
#
# Running this:
#
# $ git snapshot
#
# Creates this stash:
#
# stash@{0}: On feature/handy-git-tricks: snapshot: Mon Apr 8 12:39:06 BST 2013
#
# And seemingly no changes to your working tree.
#
snapshot = !git stash save "snapshot: $(date)" && git stash apply "stash@{0}"