forked from ryanb/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig.erb
68 lines (68 loc) · 2.74 KB
/
gitconfig.erb
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
<%
current = proc {|path| %x{git config --global #{path}}.chomp }
%>[user]
name = <%= current_or_prompt("user.name", "Your Name", ¤t) %>
email = <%= current_or_prompt("user.email", "Your Email", ¤t) %>
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[core]
excludesfile = <%= ENV['HOME'] %>/.gitignore
editor = mate -wl1
autocrlf = input
[apply]
whitespace = nowarn
[format]
pretty = %C(yellow)%h%Creset %s %C(red)(%an, %cr) %C(blue)%d%Creset
tease = %C(yellow)%h%C(reset) %C(blue)%cd%C(reset) %s %C(red)%d%C(reset)
[github]
user = <%= current_or_prompt("github.user", "GitHub Username", ¤t) %>
token = <%= current_or_prompt("github.token", "GitHub API Token", ¤t) %>
[merge]
tool = opendiff
summary = true
[alias]
st = status
ci = commit
co = checkout
br = branch
cob = checkout -b
cp = "!git checkout $(git branch | cut -c 3- | pick)"
up = !git fetch origin && git rebase origin/master
ir = !git rebase -i origin/master
ff = !git merge --ff-only `git config branch.$(git current-branch).remote`/`git current-base-branch`
ffr = !git save && git rebase && git pop
di = diff
type = cat-file -t
dump = cat-file -p
undo-last-commit = reset --soft HEAD^
kill-last-commit = reset --hard HEAD^
log-graph = log --all --graph --decorate
who = shortlog -n -s --no-merges
wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m \"wip\""
unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1"
save = stash save
pop = stash pop
ls-untracked = "ls-files --other --exclude-standard"
hist = log --pretty=format:'%h %ad | %s%d [%an]' --graph --date=short
unstage = reset HEAD --
review = "!git co -b $1-$2 upstream/qa; git pull "
current-branch = !"git br | grep \"\\*\" | awk \"{print \\$2}\""
current-base-repo = !"git config remote.$(git config branch.`git current-branch`.remote).url | cut -d: -f 2 | cut -d. -f 1"
current-base-branch = !"git config branch.$(git current-branch).merge | awk -F / '{print $3}'"
pr = !"open https://github.com/$(git current-base-repo)/pull/new/$(git current-base-branch)...$(git config github.user):$(git current-branch)"
dont-rebase = !"git config --unset branch.`git current-branch`.rebase"
use-rebase = !"git config branch.`git current-branch`.rebase true"
fetch-all = remote update --prune
prunable = !"git_prunable"
prune-merged = !"git br --merged | grep -v '^\\* ' | xargs git br -d"
kick = !"git ci --amend && git push origin -f"
brst = !"git for-each-ref refs/heads --format 'echo %(refname); git --no-pager log $(git config branch.`git current-branch`.remote)/$(git current-base-branch)..%(refname); echo' | sh"
[branch]
autosetuprebase = always
[push]
default = current
[help]
autocorrect = 1