-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgitconfig
54 lines (46 loc) · 1.82 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
[color]
diff = auto
branch = auto
status = auto
[url "[email protected]:"]
insteadOf = https://github.com/
[commit]
verbose = true
[core]
excludesfile = ~/.dotfiles/.gitignore
hooksPath = ~/.dotfiles/git_hooks
[diff]
compactionHeuristic = true
[fetch]
prune = true
[rerere]
enabled = true
[push]
default = simple
[alias]
b = "for-each-ref --sort=-committerdate --format=\"%(color:yellow)%(authordate:relative)\t%(color:red)%(authorname)\t%(color:white)%(color:bold)%(refname:short)\" refs/remotes refs/local"
ca = "commit --amend"
changed = "!f() { git status --porcelain | awk 'match($1, "U"){print $2}'; }; f"
ci = "commit"
co = "checkout"
commend = "commit --amend --no-edit"
cpc = "cherry-pick --continue"
desc = "describe"
draft = "!f() { git push origin HEAD:refs/drafts/$1; }; f"
drop1 = "stash drop stash@{0}"
editlast = "!vim `git diff-tree --no-commit-id --name-only -r HEAD`"
editcommit ="!vim `git show --pretty="format:" --name-only -r $1`"
f = "fetch --all"
find = "!f() { git branch | fzf --query=$1 | xargs git checkout ; }; f"
hist = "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
ignore = "update-index --assume-unchanged"
unignore = "!git update-index --no-assume-unchanged $1; git reset HEAD $1; git checkout $1"
ls = "log --oneline"
mff = "merge --no-ff"
nuke = "!git clean -fdx"
rco = "!f() { git fetch origin $1 && git checkout -b $1 FETCH_HEAD ; }; f"
patch = "add --patch"
stag = "!git tag -s -a"
submit = "!f() { git push origin HEAD:refs/for/$1; }; f"
undo = "reset --soft HEAD^"
change-commits = "!f() { VAR=$1; OLD=$2; NEW=$3; shift 3; git filter-branch -f --env-filter \"if [[ \\\"$`echo $VAR`\\\" = '$OLD' ]]; then export $VAR='$NEW'; fi\" $@; }; f "