Skip to content

Commit

Permalink
push.bat
Browse files Browse the repository at this point in the history
  • Loading branch information
HbhHub committed Aug 15, 2024
1 parent 3b9571a commit c4a5023
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions boke/tools/git使用.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
##### 常用命令和含义

```
git init
git add .
git commit -m "xxxx"
```

```
```

17 changes: 17 additions & 0 deletions push.bat
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit c4a5023

Please sign in to comment.