-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitconfig
69 lines (69 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
63
64
65
66
67
68
69
[color]
ui = true
branch = auto
diff = auto
status = auto
[alias]
co = checkout
ci = commit
st = status
# ログを表示する
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short --all --oneline --decorate
# history
day = "!f() { days=${1:-1}; repo_url=\"https://github.com/$(git org)/$(git repository)/commit/\"; git log --since=\"$days days ago\" --author='Yuki Adachi' --pretty=format:\"%ad | ${repo_url}%h | %s [%an]\" --date=iso --all; }; f"
# fetch & rebase
f = "!git fetch --all --prune && git rebase origin/$(git branch-name)"
# push & open github
p = "!git push origin HEAD && type gh > /dev/null && gh pr create --web"
# 現在のリポジトリを表示する
repository = "!git remote -v|grep origin|grep fetch|awk -F '.git ' '{print $1}'|awk -F '/' '{print $NF}'"
# 現在のプロジェクト(org)を表示する
org = "!git remote -v|grep origin|grep fetch|awk -F 'https://github.com/|@github.com:|@bitbucket.org:' '{print $2}'|awk -F '/' '{print $1}'"
# 現在のブランチ名を表示する
branch-name = "!git rev-parse --abbrev-ref HEAD"
# 現在のgit hashを表示する
short-hash = "!git rev-parse --short HEAD"
# 現在の$org/$repository/$branchのURLを表示する
url-github = "!echo https://github.com/$(git org)/$(git repository)/tree/$(git branch-name)"
# master|mainをcheckoutする
master = "!git checkout master 2>/dev/null || git checkout main"
# main|masterをcheckoutする
main = "!git master"
[push]
default = nothing
[include]
path = ~/.gitconfig.local
#[init]
# templatedir = ~/.git_template
[filter "lfs"]
required = true
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
[mergetool "vimdiff3"]
cmd = ~/bin/git_merge_wrapper3 \"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
[mergetool]
keepBackup = false
[pull]
ff = only
rebase = false
[diff]
algorithm = histogram
colorMoved = dimmed-zebra
[core]
# editor = code --wait
editor = vim
excludesFile = ~/.gitignore
[diff]
tool = vscode
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[merge]
tool = vscode
[mergetool "vscode"]
cmd = code --wait $MERGED
[init]
defaultBranch = main
[user]
name = Yuki Adachi
email = 177159+yuki777@users.noreply.github.com