Files
assist/simple_git_push.bat
Jeason 20c5ce355a fix: 修复前端导航和页面跳转问题
- 添加统一的导航菜单到所有页面
- 修复页面路由映射和高亮状态
- 创建 navigation.js 统一管理页面跳转
- 添加 test_navigation.py 路由测试工具
- 支持仪表板、预警管理、智能对话、HTTP对话页面间无缝切换

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 10:12:17 +08:00

109 lines
2.7 KiB
Batchfile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion
echo ========================================
echo 简单Git推送工具
echo ========================================
echo.
:: 1. 显示Git状态
echo [1] Git状态:
git status --short
echo.
:: 2. 显示远程仓库
echo [2] 远程仓库:
git remote -v
if %errorlevel% neq 0 (
echo 错误: 未配置远程仓库
pause
exit /b 1
)
echo.
:: 3. 显示当前分支
echo [3] 当前分支:
for /f "tokens=*" %%b in ('git branch --show-current 2^>nul') do set branch=%%b
if "!branch!"=="" (
echo 警告: 无法获取分支名称尝试使用main
set branch=main
)
echo 分支: !branch!
echo.
:: 4. 检查是否有未提交的更改
echo [4] 检查未提交的更改...
git diff --quiet
set has_uncommitted=%errorlevel%
git diff --cached --quiet
set has_staged=%errorlevel%
if %has_uncommitted% neq 0 (
echo 有未暂存的更改
)
if %has_staged% neq 0 (
echo 有已暂存的更改
)
if %has_uncommitted% equ 0 if %has_staged% equ 0 (
echo 所有更改已提交
)
echo.
:: 5. 尝试推送
echo [5] 开始推送...
echo 命令: git push origin !branch!
echo.
git push origin !branch! 2>&1 | findstr /v "^$"
set push_error=!errorlevel!
if !push_error! equ 0 (
echo.
echo ========================================
echo 推送成功!
echo ========================================
) else (
echo.
echo ========================================
echo 推送失败!错误码: !push_error!
echo ========================================
echo.
echo 尝试设置上游并推送...
git push -u origin !branch! 2>&1 | findstr /v "^$"
set push_u_error=!errorlevel!
if !push_u_error! equ 0 (
echo.
echo ========================================
echo 推送成功(已设置上游)!
echo ========================================
) else (
echo.
echo ========================================
echo 推送仍然失败
echo ========================================
echo.
echo 常见问题和解决方案:
echo.
echo 1. 认证问题:
echo - 检查SSH密钥: ssh -T git@github.com (GitHub)
echo - 检查SSH密钥: ssh -T git@gitee.com (Gitee)
echo - 或使用HTTPS + Personal Access Token
echo.
echo 2. 远程仓库地址:
git config --get remote.origin.url
echo.
echo 3. 分支冲突:
echo - 先拉取: git pull origin !branch! --rebase
echo - 解决冲突后推送: git push origin !branch!
echo.
echo 4. 检查网络连接和远程仓库权限
echo.
)
)
echo.
pause