-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig
38 lines (38 loc) · 2.06 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
[alias]
s = status
d = diff
di = diff --ignore-space-change
dc = diff --cached
dci = diff --cached --ignore-space-change
sh = show --ignore-space-change
co = checkout
a = add
ap = add -p
c = commit
# Commit with localizable timezone information (checks user.tz config option)
ctz = "!f() { GITZ=$(git config user.tz); if [ -z \"$GITZ\" ]; then git commit $@; else git commit --date=\"`TZ=\\\"$GITZ\\\" date +%Y-%m-%dT%H:%M:%S%z`\" $@; fi; }; f"
ca = commit --amend
uncommit = reset --soft HEAD^
unstage = reset HEAD
ours = "!f() { git co --ours $@ && git add $@; }; f"
theirs = "!f() { git co --theirs $@ && git add $@; }; f"
rio = "!git rebase -i $(git merge-base HEAD origin/$(git remote show origin | sed -n '/HEAD branch/s/.*: //p'))"
b = branch
ss = stash save --keep-index
sp = stash pop
sa = stash apply
sl = stash list
p = "!f() { git pull --ff-only origin `git rev-parse --abbrev-ref HEAD`; }; f"
po = "!f() { git pull origin `git rev-parse --abbrev-ref HEAD`; }; f"
por = "!f() { git pull --rebase origin `git rev-parse --abbrev-ref HEAD`; }; f"
pusho = "!f() { git push \"$@\" origin `git rev-parse --abbrev-ref HEAD`; }; f"
glog = "!f() { git log --graph --format=\"%C(blue)%h%C(reset) %s (%C(green)%an%C(reset), %ar)\"; }; f"
wc = whatchanged
wc1 = whatchanged -1
track = "!f() { git remote update >/dev/null 2>&1 && git checkout -b \"$@\" origin/\"$@\"; }; f"
files = "!f() { git diff-tree --name-only --no-commit-id -r ${1-HEAD}; }; f"
downstream = "!f() { git remote update >/dev/null 2>&1 && git wc $@ `git rev-parse --abbrev-ref --symbolic-full-name @{u}`..HEAD; }; f"
upstream = "!f() { git remote update >/dev/null 2>&1 && git wc $@ HEAD..`git rev-parse --abbrev-ref --symbolic-full-name @{u}`; }; f"
stats = "!f() { git shortlog -n --summary `git log -1 --before \"$1\" --pretty=format:"%h"`..`git log -1 --before \"$2\" --pretty=format:"%h"`; }; f"
standup = shortlog --since=yesterday
la = "!git config -l|grep \"^alias\\.\"|cut -c 7-"