-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
##### 常用命令和含义 | ||
|
||
``` | ||
git init | ||
git add . | ||
git commit -m "xxxx" | ||
``` | ||
|
||
``` | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |