@jswork/ushell-module-git 1.0.49 → 1.0.51

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
@@ -10,6 +10,7 @@ source $ROOT_PATH/modules/11-lazygit.sh
10
10
  ## git base:
11
11
  alias gl='git pull'
12
12
  alias glo='git pull origin '
13
+ alias glom='git pull origin main'
13
14
  alias gp='git push'
14
15
 
15
16
  # git logs
@@ -88,6 +89,7 @@ alias ggt="${ROOT_PATH}/modules/03-quick-tag.sh"
88
89
  alias fixup="${ROOT_PATH}/modules/10-fixup.sh"
89
90
  alias git-reset="${ROOT_PATH}/modules/04-reset-git.sh"
90
91
  alias git-clean="${ROOT_PATH}/modules/06-git-clean.sh"
92
+ alias rmb="${ROOT_PATH}/modules/13-del-branch.sh"
91
93
 
92
94
 
93
95
  # check git repo size
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # 检查是否提供了分支名称作为第一个参数
4
+ if [ -z "$1" ]; then
5
+ echo "Usage: $0 <branch_name> [default_branch]"
6
+ exit 1
7
+ fi
8
+
9
+ # 获取分支名称和默认分支名称
10
+ BRANCH_NAME=$1
11
+ DEFAULT_BRANCH=${2:-main} # 如果没有提供第二个参数,默认为 main
12
+
13
+ # 切换到默认分支
14
+ echo "Switching to default branch ($DEFAULT_BRANCH)..."
15
+ git checkout $DEFAULT_BRANCH || { echo "Failed to switch to $DEFAULT_BRANCH branch"; exit 1; }
16
+
17
+ # 删除本地分支
18
+ echo "Deleting local branch ($BRANCH_NAME)..."
19
+ git branch -D $BRANCH_NAME || { echo "Failed to delete local branch $BRANCH_NAME"; exit 1; }
20
+
21
+ # 删除远程分支
22
+ echo "Deleting remote branch ($BRANCH_NAME)..."
23
+ git push origin --delete $BRANCH_NAME || { echo "Failed to delete remote branch $BRANCH_NAME"; exit 1; }
24
+
25
+ echo "Branch '$BRANCH_NAME' has been successfully deleted locally and remotely."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jswork/ushell-module-git",
3
- "version": "1.0.49",
3
+ "version": "1.0.51",
4
4
  "description": "Unix like shell module for git.",
5
5
  "main": "index.sh",
6
6
  "repository": {