@jswork/ushell-module-git 1.0.51 → 1.0.53
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
CHANGED
|
@@ -79,6 +79,7 @@ alias gdc='git diff --cached'
|
|
|
79
79
|
alias gk='gitk --all&'
|
|
80
80
|
alias gx='gitx --all'
|
|
81
81
|
alias gg="${ROOT_PATH}/modules/05-quick-commit.sh"
|
|
82
|
+
alias ggl="${ROOT_PATH}/modules/05-1-quick-commit-no-push.sh"
|
|
82
83
|
alias gi="oaic -al"
|
|
83
84
|
alias gi2="${ROOT_PATH}/modules/12-ggi.sh"
|
|
84
85
|
alias ggg='gaa && gcm "wip" && gp'
|
package/modules/13-del-branch.sh
CHANGED
|
@@ -14,9 +14,13 @@ DEFAULT_BRANCH=${2:-main} # 如果没有提供第二个参数,默认为 main
|
|
|
14
14
|
echo "Switching to default branch ($DEFAULT_BRANCH)..."
|
|
15
15
|
git checkout $DEFAULT_BRANCH || { echo "Failed to switch to $DEFAULT_BRANCH branch"; exit 1; }
|
|
16
16
|
|
|
17
|
-
#
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
# 检查本地分支是否存在
|
|
18
|
+
if git show-ref --quiet --verify refs/heads/$BRANCH_NAME; then
|
|
19
|
+
echo "Deleting local branch ($BRANCH_NAME)..."
|
|
20
|
+
git branch -D $BRANCH_NAME || { echo "Failed to delete local branch $BRANCH_NAME"; exit 1; }
|
|
21
|
+
else
|
|
22
|
+
echo "Local branch '$BRANCH_NAME' does not exist. Skipping local deletion."
|
|
23
|
+
fi
|
|
20
24
|
|
|
21
25
|
# 删除远程分支
|
|
22
26
|
echo "Deleting remote branch ($BRANCH_NAME)..."
|