feat: update gitcofig
This commit is contained in:
+6
-6
@@ -19,12 +19,12 @@ set -gx EDITOR vim
|
|||||||
|
|
||||||
# alias
|
# alias
|
||||||
# git
|
# git
|
||||||
abbr -a gitb "git branch --show-current | tr -d '\n' | pbcopy"
|
alias gitb="git branch --show-current | tr -d '\n' | pbcopy"
|
||||||
abbr -a gci "golangci-lint run -c=~/.dotfile/.golangci.yml ./..."
|
alias gci="golangci-lint run -c=~/.dotfile/.golangci.yml ./..."
|
||||||
abbr -a gmt "go mod tidy"
|
alias gmt="go mod tidy"
|
||||||
abbr -a gtc "go test -gcflags=all=-l -cover ./..."
|
alias gtc="go test -gcflags=all=-l -cover ./..."
|
||||||
abbr -a swg "swag init -o docs -g "
|
alias swg="swag init -o docs -g "
|
||||||
abbr -a sws "swagger serve -F=swagger"
|
alias sws="swagger serve -F=swagger"
|
||||||
|
|
||||||
function gtr
|
function gtr
|
||||||
go test -gcflags=all=-l -v -run="$1"
|
go test -gcflags=all=-l -v -run="$1"
|
||||||
|
|||||||
+55
-40
@@ -1,51 +1,66 @@
|
|||||||
[user]
|
[user]
|
||||||
name = Laily
|
name = Laily
|
||||||
email = i@laily.net
|
email = i@laily.net
|
||||||
[core]
|
[core]
|
||||||
autocrlf = input
|
autocrlf = input
|
||||||
quotepath = false
|
quotepath = false
|
||||||
editor = /usr/local/bin/nvim
|
editor = nvim
|
||||||
excludesfile = ~/.dotfile/git/.gitignore
|
excludesfile = ~/.dotfile/git/.gitignore
|
||||||
[push]
|
[push]
|
||||||
default = current
|
default = current
|
||||||
[pull]
|
[pull]
|
||||||
rebase = false
|
rebase = false
|
||||||
|
[color]
|
||||||
|
status = auto
|
||||||
|
diff = auto
|
||||||
|
branch = auto
|
||||||
|
interactive = auto
|
||||||
|
grep = auto
|
||||||
|
ui = auto
|
||||||
[merge]
|
[merge]
|
||||||
tool = vimdiff
|
tool = nvimdiff
|
||||||
|
[difftool "nvimdiff"]
|
||||||
|
cmd = nvim -d \"$LOCAL\" \"$REMOTE\"
|
||||||
|
[mergetool "nvimdiff"]
|
||||||
|
cmd = nvim -d \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
|
||||||
|
trustExitCode = true
|
||||||
[includeIf "gitdir:~/workrepo/"]
|
[includeIf "gitdir:~/workrepo/"]
|
||||||
path = ~/.workgitconfig
|
path = ~/.workgitconfig
|
||||||
[branch]
|
[branch]
|
||||||
autoSetupMerge = always
|
autoSetupMerge = always
|
||||||
[alias]
|
[alias]
|
||||||
au = add -u
|
au = add -u
|
||||||
co = checkout
|
co = checkout
|
||||||
cm = "!f() { if [[ -z \"$1\" ]]; then git commit; else git commit -m \"$*\"; fi; }; f"
|
cm = "!f() { if [[ -z \"$1\" ]]; then git commit; else git commit -m \"$*\"; fi; }; f"
|
||||||
st = status
|
st = status
|
||||||
ap = add -p
|
ap = add -p
|
||||||
br = branch
|
br = branch
|
||||||
pl = pull
|
ba = branch -a
|
||||||
pt = push origin --tags
|
bm = branch --merged
|
||||||
merge2 = !sh -c '_CURRENT_BRANCH=$(git symbolic-ref --short HEAD) && git checkout $1 && git merge $_CURRENT_BRANCH && git checkout $_CURRENT_BRANCH' -
|
bn = branch --no-merged
|
||||||
bg = "!f() { git branch | grep $1; }; f"
|
pl = pull
|
||||||
delbr = "!f(){ git branch -D $(git branch | grep \"\b$1\"); };f"
|
pt = push origin --tags
|
||||||
can = commit --amend --no-edit
|
merge2 = !sh -c '_CURRENT_BRANCH=$(git symbolic-ref --short HEAD) && git checkout $1 && git merge $_CURRENT_BRANCH && git checkout $_CURRENT_BRANCH' -
|
||||||
cleanbr = "!git branch --merged master | grep -v '\\*\\|master\\|main' | xargs -n 1 git branch -d"
|
bg = "!f() { git branch | grep $1; }; f"
|
||||||
# list files which have changed since REVIEW_BASE
|
delbr = "!f(){ git branch -D $(git branch | grep \"\b$1\"); };f"
|
||||||
# (REVIEW_BASE defaults to 'master' in my zshrc)
|
can = commit --amend --no-edit
|
||||||
files = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\")
|
cleanbr = "!git branch --merged master | grep -v '\\*\\|master\\|main' | xargs -n 1 git branch -d"
|
||||||
|
# list files which have changed since REVIEW_BASE
|
||||||
|
# (REVIEW_BASE defaults to 'master' in my zshrc)
|
||||||
|
files = !git diff --name-only $(git merge-base HEAD \"$REVIEW_BASE\")
|
||||||
|
|
||||||
# Same as above, but with a diff stat instead of just names
|
# Same as above, but with a diff stat instead of just names
|
||||||
# (better for interactive use)
|
# (better for interactive use)
|
||||||
stat = !git diff --stat $(git merge-base HEAD \"$REVIEW_BASE\")
|
stat = !git diff --stat $(git merge-base HEAD \"$REVIEW_BASE\")
|
||||||
# Open all files changed since REVIEW_BASE in Vim tabs
|
# Open all files changed since REVIEW_BASE in Vim tabs
|
||||||
# Then, run fugitive's :Gdiff in each tab, and finally
|
# Then, run fugitive's :Gdiff in each tab, and finally
|
||||||
# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
|
# tell vim-gitgutter to show +/- for changes since REVIEW_BASE
|
||||||
review = !vim -p $(git files) +\"tabdo Gdiffsplit $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
|
review = !vim -p $(git files) +\"tabdo Gdiffsplit $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
|
||||||
|
|
||||||
# Same as the above, except specify names of files as arguments,
|
# Same as the above, except specify names of files as arguments,
|
||||||
# instead of opening all files:
|
# instead of opening all files:
|
||||||
# git reviewone foo.js bar.js
|
# git reviewone foo.js bar.js
|
||||||
reviewone = !vim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
|
reviewone = !vim -p +\"tabdo Gdiff $REVIEW_BASE\" +\"let g:gitgutter_diff_base = '$REVIEW_BASE'\"
|
||||||
#git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Laily'; GIT_AUTHOR_EMAIL='i@laily.net'; GIT_COMMITTER_NAME='Laily'; GIT_COMMITTER_EMAIL='i@laily.net';" HEAD
|
#git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Laily'; GIT_AUTHOR_EMAIL='i@laily.net'; GIT_COMMITTER_NAME='Laily'; GIT_COMMITTER_EMAIL='i@laily.net';" HEAD
|
||||||
[protocol "file"]
|
[protocol "file"]
|
||||||
allow = always
|
allow = always
|
||||||
|
|||||||
Reference in New Issue
Block a user