@jswork/ushell-module-git 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.sh +60 -58
- package/package.json +1 -1
- package/modules/10-opc.sh +0 -15
package/index.sh
CHANGED
|
@@ -1,96 +1,98 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
## path:
|
|
3
|
-
ROOT_PATH=$(dirname $BASH_SOURCE)
|
|
3
|
+
ROOT_PATH=$(dirname $BASH_SOURCE)
|
|
4
4
|
|
|
5
5
|
# 这个与我的命令 github-flow 冲突,所以暂时不用了
|
|
6
6
|
# source $ROOT_PATH/modules/02-git-flow.sh;
|
|
7
|
-
source $ROOT_PATH/modules/07-git-rebase.sh
|
|
8
|
-
source $ROOT_PATH/modules/11-lazygit.sh
|
|
7
|
+
source $ROOT_PATH/modules/07-git-rebase.sh
|
|
8
|
+
source $ROOT_PATH/modules/11-lazygit.sh
|
|
9
9
|
|
|
10
10
|
## git base:
|
|
11
|
-
alias gl='git pull'
|
|
12
|
-
alias glo='git pull origin '
|
|
13
|
-
alias gp='git push'
|
|
14
|
-
alias gpo='git push origin '
|
|
15
|
-
alias gpof='git push origin -f'
|
|
11
|
+
alias gl='git pull'
|
|
12
|
+
alias glo='git pull origin '
|
|
13
|
+
alias gp='git push'
|
|
14
|
+
alias gpo='git push origin '
|
|
15
|
+
alias gpof='git push origin -f'
|
|
16
16
|
|
|
17
17
|
# push branchs/tags/deletes
|
|
18
|
-
alias gpa='git push --all -u'
|
|
19
|
-
alias gpd="git push origin --delete "
|
|
18
|
+
alias gpa='git push --all -u'
|
|
19
|
+
alias gpd="git push origin --delete "
|
|
20
20
|
|
|
21
|
-
alias gaa='git add .'
|
|
22
|
-
alias gcm='git commit -m '
|
|
23
|
-
alias gam='git commit -am '
|
|
24
|
-
alias goo='git checkout origin '
|
|
25
|
-
alias gc='git clone'
|
|
26
|
-
alias gc1='git clone --depth=1'
|
|
21
|
+
alias gaa='git add .'
|
|
22
|
+
alias gcm='git commit -m '
|
|
23
|
+
alias gam='git commit -am '
|
|
24
|
+
alias goo='git checkout origin '
|
|
25
|
+
alias gc='git clone'
|
|
26
|
+
alias gc1='git clone --depth=1'
|
|
27
27
|
|
|
28
28
|
# clean untrack files
|
|
29
29
|
# https://stackoverflow.com/questions/61212/how-to-remove-local-untracked-files-from-the-current-git-working-tree
|
|
30
|
-
alias gcf='git clean -f'
|
|
30
|
+
alias gcf='git clean -f'
|
|
31
31
|
|
|
32
32
|
# git fetch:
|
|
33
|
-
alias gfo='git fetch origin'
|
|
34
|
-
alias gft='git fetch'
|
|
35
|
-
alias gfa='git fetch --all'
|
|
36
|
-
alias gfp='git fetch --all --prune'
|
|
37
|
-
|
|
33
|
+
alias gfo='git fetch origin'
|
|
34
|
+
alias gft='git fetch'
|
|
35
|
+
alias gfa='git fetch --all'
|
|
36
|
+
alias gfp='git fetch --all --prune'
|
|
38
37
|
|
|
39
38
|
## git revert:
|
|
40
|
-
alias gr='git checkout -f'
|
|
41
|
-
alias grf='git clean -fd'
|
|
42
|
-
alias
|
|
43
|
-
alias
|
|
44
|
-
alias
|
|
45
|
-
|
|
39
|
+
alias gr='git checkout -f'
|
|
40
|
+
alias grf='git clean -fd'
|
|
41
|
+
alias grr='git checkout -f && git clean -fd'
|
|
42
|
+
alias gck='git checkout '
|
|
43
|
+
alias g-='git checkout -'
|
|
44
|
+
alias gcy='git cherry-pick'
|
|
46
45
|
|
|
47
46
|
# merge:
|
|
48
|
-
alias gm='git merge '
|
|
49
|
-
alias gmm='git merge master'
|
|
50
|
-
alias gmd='git merge develop'
|
|
51
|
-
alias gmdev='git merge dev'
|
|
47
|
+
alias gm='git merge '
|
|
48
|
+
alias gmm='git merge master'
|
|
49
|
+
alias gmd='git merge develop'
|
|
50
|
+
alias gmdev='git merge dev'
|
|
52
51
|
|
|
53
52
|
# merge from remote:
|
|
54
|
-
alias gmmr='git merge origin/master'
|
|
55
|
-
alias gmdr='git merge origin/develop'
|
|
56
|
-
alias gmdevr='git merge origin/dev'
|
|
53
|
+
alias gmmr='git merge origin/master'
|
|
54
|
+
alias gmdr='git merge origin/develop'
|
|
55
|
+
alias gmdevr='git merge origin/dev'
|
|
57
56
|
|
|
58
57
|
## chekcout
|
|
59
|
-
alias gckm='git checkout master 2>/dev/null || git checkout main 2>/dev/null'
|
|
60
|
-
alias gckd='git checkout develop 2>/dev/null || git checkout dev 2>/dev/null'
|
|
61
|
-
alias gckb='git checkout beta'
|
|
62
|
-
alias gckr='git checkout release'
|
|
58
|
+
alias gckm='git checkout master 2>/dev/null || git checkout main 2>/dev/null'
|
|
59
|
+
alias gckd='git checkout develop 2>/dev/null || git checkout dev 2>/dev/null'
|
|
60
|
+
alias gckb='git checkout beta'
|
|
61
|
+
alias gckr='git checkout release'
|
|
63
62
|
|
|
64
63
|
## git others:
|
|
65
|
-
alias gs='git status '
|
|
66
|
-
alias ga='git add '
|
|
67
|
-
alias gb='git branch '
|
|
68
|
-
alias gbh='git branch -h'
|
|
69
|
-
alias gd='git diff'
|
|
70
|
-
alias gk='gitk --all&'
|
|
71
|
-
alias gx='gitx --all'
|
|
72
|
-
alias gg="${ROOT_PATH}/modules/05-quick-commit.sh"
|
|
73
|
-
alias ggg='gaa && gcm "wip" && gp'
|
|
64
|
+
alias gs='git status '
|
|
65
|
+
alias ga='git add '
|
|
66
|
+
alias gb='git branch '
|
|
67
|
+
alias gbh='git branch -h'
|
|
68
|
+
alias gd='git diff'
|
|
69
|
+
alias gk='gitk --all&'
|
|
70
|
+
alias gx='gitx --all'
|
|
71
|
+
alias gg="${ROOT_PATH}/modules/05-quick-commit.sh"
|
|
72
|
+
alias ggg='gaa && gcm "wip" && gp'
|
|
74
73
|
|
|
75
74
|
## git tags:
|
|
76
|
-
alias gcd=". ${ROOT_PATH}/modules/01-gcd.sh"
|
|
77
|
-
alias ggt="${ROOT_PATH}/modules/03-quick-tag.sh"
|
|
78
|
-
alias git-reset="${ROOT_PATH}/modules/04-reset-git.sh"
|
|
79
|
-
alias git-clean="${ROOT_PATH}/modules/06-git-clean.sh"
|
|
80
|
-
|
|
75
|
+
alias gcd=". ${ROOT_PATH}/modules/01-gcd.sh"
|
|
76
|
+
alias ggt="${ROOT_PATH}/modules/03-quick-tag.sh"
|
|
77
|
+
alias git-reset="${ROOT_PATH}/modules/04-reset-git.sh"
|
|
78
|
+
alias git-clean="${ROOT_PATH}/modules/06-git-clean.sh"
|
|
81
79
|
|
|
82
80
|
# check git repo size
|
|
83
|
-
alias git-size="git count-objects -vH"
|
|
81
|
+
alias git-size="git count-objects -vH"
|
|
84
82
|
|
|
85
83
|
## add github cache:
|
|
86
|
-
alias github-cache='ssh-add ~/.ssh/id_rsa.github.com >/dev/null 2>/dev/null;'
|
|
84
|
+
alias github-cache='ssh-add ~/.ssh/id_rsa.github.com >/dev/null 2>/dev/null;'
|
|
87
85
|
|
|
88
86
|
## move subdirs to root:
|
|
89
|
-
alias mvg="${ROOT_PATH}/modules/08-mvg.sh"
|
|
87
|
+
alias mvg="${ROOT_PATH}/modules/08-mvg.sh"
|
|
90
88
|
|
|
91
89
|
# oprr
|
|
92
|
-
alias oprr="${ROOT_PATH}/modules/09-oprr.sh"
|
|
93
|
-
alias opc="$
|
|
90
|
+
alias oprr="${ROOT_PATH}/modules/09-oprr.sh"
|
|
91
|
+
alias opc="open $(guc -c)"
|
|
92
|
+
|
|
93
|
+
# stash
|
|
94
|
+
alias gst1='git stash'
|
|
95
|
+
alias gst2='git stash pop'
|
|
94
96
|
|
|
95
97
|
# git-url-cli
|
|
96
98
|
# alias guc='git-url-cli'
|
package/package.json
CHANGED
package/modules/10-opc.sh
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
|
|
3
|
-
# GIT_URL: git@github.com:afeiship/ushell-module-git.git
|
|
4
|
-
GIT_URL=$(git config --get remote.origin.url)
|
|
5
|
-
|
|
6
|
-
# 从 GIT_URL 中 获取 applyai-dev/applyai-frontend
|
|
7
|
-
REPO_PATH=$(echo "$GIT_URL" | awk -F'[:/]' '{print $(NF-1)"/"$NF}' | cut -d '.' -f 1)
|
|
8
|
-
|
|
9
|
-
# 获取当前分支名称
|
|
10
|
-
CURRENT_BRANCH=$(git branch --show-current)
|
|
11
|
-
|
|
12
|
-
BRANCH=${1:-$CURRENT_BRANCH}
|
|
13
|
-
|
|
14
|
-
# 打开 GitHub 对比页面
|
|
15
|
-
open "https://github.com/$REPO_PATH/commits/$BRANCH"
|