From c4a5023210a79ecd74d197b5ce189aa40f308222 Mon Sep 17 00:00:00 2001 From: hubOverride <1346301152@qq.com> Date: Thu, 15 Aug 2024 15:48:55 +0800 Subject: [PATCH] push.bat --- "boke/tools/git\344\275\277\347\224\250.md" | 12 ++++++++++++ push.bat | 17 +++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 "boke/tools/git\344\275\277\347\224\250.md" create mode 100644 push.bat diff --git "a/boke/tools/git\344\275\277\347\224\250.md" "b/boke/tools/git\344\275\277\347\224\250.md" new file mode 100644 index 0000000..02011c0 --- /dev/null +++ "b/boke/tools/git\344\275\277\347\224\250.md" @@ -0,0 +1,12 @@ +##### 常用命令和含义 + +``` +git init +git add . +git commit -m "xxxx" +``` + +``` + +``` + diff --git a/push.bat b/push.bat new file mode 100644 index 0000000..ccb1017 --- /dev/null +++ b/push.bat @@ -0,0 +1,17 @@ +@echo off +setlocal + +:: 获取当前分支名称 +for /f "tokens=*" %%a in ('git rev-parse --abbrev-ref HEAD') do set BRANCH_NAME=%%a + +:: 遍历所有远程仓库 +for /f "tokens=1" %%r in ('git remote') do ( + echo Pushing to %%r/%BRANCH_NAME%... + git push %%r %BRANCH_NAME% + if %errorlevel% neq 0 ( + echo Failed to push to %%r/%BRANCH_NAME% + ) +) + +echo Push to all remotes completed. +endlocal \ No newline at end of file