-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
62 lines (51 loc) · 2.32 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
# This is Git's per-user configuration file.
# Please adapt and uncomment the following lines:
[user]
name = Shusaku-Sahashi
username = Shusaku-Sahashi
email = [email protected]
# git-lfs
# https://qiita.com/ikmski/items/5cc8b8832336b8d85429
[filter "lfs"]
process = git-lfs filter-process
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
[color]
ui = auto
[core]
editor = vim
excludesfile = ~/.global_gitignore
autocrlf = input
[alias]
aliases = !git config --get-regexp '^alias\\.' | sed 's/alias\\.\\([^ ]*\\) \\(.*\\)/\\1\\\t => \\2/'
plog = log --pretty='format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an]' --date=iso
glog = log --pretty='format:%C(yellow)%h %C(green)%cd %C(reset)%s %C(red)%d %C(cyan)[%an]' --date=format:'%c' --all --graph
showpr = "!f() { git log --merges --oneline --reverse --ancestry-path $1...master | grep 'Merge pull request #' | head -n 1; }; f"
openpr = "!f() { hub browse -- `git log --merges --oneline --reverse --ancestry-path $1...master | grep 'Merge pull request #' | head -n 1 | cut -f5 -d' ' | sed -e 's%#%pull/%'`; }; f"
st = status
ft = fetch -p
diff = diff --word-diff
pull-mybranch = !git symbolic-ref --short HEAD | xargs git pull origin
clean-branch = !git checkout main | git branch --merged | grep -E 'develop|feature' | xargs git branch -d | git checkout -
choo = "!f() { git checkout origin/$1; }; f"
stash = stash -u
init-commit = commit --allow-empty -m "init commit"
# https://qiita.com/yukiarrr/items/9c21d97f6c8ac31de157#4-stash%E4%B8%80%E8%A6%A7%E3%82%92%E3%82%82%E3%81%A3%E3%81%A8%E8%A6%8B%E3%82%84%E3%81%99%E3%81%8F%E3%81%97%E3%81%9F%E3%81%84
co = "!f() { args=$@; if [ -z \"$args\" ]; then branch=$(git branch --all | grep -v HEAD | fzf --preview 'echo {} | cut -c 3- | xargs git log --color=always' | cut -c 3-); git checkout $(echo $branch | sed 's#remotes/[^/]*/##'); else git checkout $args; fi }; f"
# for ghq
get = !ghq get -p # クローン
list = !ghq list # リポジトリ一覧
root = "!exc $SHELL ; :" # 作業リポジトリのトップに移動
cd = "!ghq-cd ; :"
[hub]
protocol = ssh
[merge]
ff = false
tool = vimdiff
[pull]
ff = only
[init]
defaultBranch = main
[include]
path = ~/.gitconfig.local