# itgeeker_batch_git_pull_and_push **Repository Path**: itgeeker/itgeeker_batch_git_pull_and_push ## Basic Information - **Project Name**: itgeeker_batch_git_pull_and_push - **Description**: 技术奇客开源软件系列 - 带图形界面的批量Git Pull和Git Push工具。 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-07-29 - **Last Updated**: 2026-07-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: Git, Git批量处理, Git图形界面, itgeeker, 技术奇客 ## README # ITGeeker Batch Git Pull And Push ## 技术奇客批量 Git 拉取和推送工具 > 🌐 **English version:** see [README.en.md](./README.en.md). [![License: Mulan PSL v2](https://img.shields.io/badge/license-Mulan%20PSL%20v2-blue.svg)](./LICENSE) [![Python](https://img.shields.io/badge/python-3.10%2B-blue.svg)](./pyproject.toml) [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20Linux-lightgrey.svg)](./pyproject.toml) [![GUI](https://img.shields.io/badge/GUI-Tkinter-orange.svg)](./ui.py) [![Git](https://img.shields.io/badge/git-required-success.svg)](https://git-scm.com/) 一个带图形界面的批量 Git Pull 和 Git Push 桌面工具,专为同时维护多个本地 Git 仓库的开发者打造。 [GitHub 镜像](https://github.com/alanljj/itgeeker_batch_git_pull_and_push) · [Gitee 镜像](https://gitee.com/itgeeker/itgeeker_batch_git_pull_and_push) · [ITGeeker 博客](https://www.itgeeker.net) --- ## 项目简介 本工具属于 ITGeeker(技术奇客)开源软件系列。它提供一个 Tkinter 桌面图形界面,用来管理一组本地 Git 仓库,并对这些仓库一次性执行批量 `git pull`,或者 `git add` → `git commit` → `git push` 流水线。所有本地仓库、远程地址、SSH key 或 HTTPS 凭据都需要在运行前自行准备;本工具不替代 Git 本身,也不保存任何远程凭据。 --- ## 核心特性 - 📂 自由添加或删除待处理的本地仓库目录;列表在退出时自动保存,并在下次启动时自动恢复。 - 🚀 一键对所有列表目录执行批量 `git pull`,或依次执行 `git add --all .` → `git commit -m ` → `git push`。 - 💾 列表支持导出 / 导入为 JSON 文件,方便在多台机器之间共享。窗口位置、提交信息模板、自动 `git add` 开关等偏好也会一并保存。 - 🖥️ 系统托盘常驻(基于 `pystray`),支持显示 / 隐藏、设置、关于、退出;托盘提示显示程序名、版本号、开发者。 - 🔒 单实例运行锁,长时间 Git 操作在后台线程中执行,UI 主循环不会卡顿。 - 📁 配置文件统一保存在用户主目录下,跨 Windows 与 Linux 行为一致。 --- ## 屏幕截图
![ITGeeker Batch Git Pull And Push 主界面](assets/batch_git_pull_and_push_2023-07-08_19-15-09.png "ITGeeker Batch Git Pull And Push - 主界面")
> 该界面由 Tkinter 渲染。后续可替换为 GIF 演示文件(如 `assets/batch_pull_push_demo.gif`)。 --- ## 快速上手 ### 环境要求 - **Python 3.10 或更高版本**:项目使用 `from __future__ import annotations` 等现代语法,`pyproject.toml` 中显式声明 `requires-python = ">=3.10"`。 - **Git 命令行客户端**:`git` 必须在 `PATH` 中可调用,所有 Git 操作都通过 `subprocess` 调用外部 `git` 二进制。 - **可用的 Tk 桌面环境**:Windows 自带的 Tk 即可;Linux 发行版通常需要单独安装 Tk 包(例如 Debian / Ubuntu 的 `python3-tk`)。 - **已存在的本地仓库、远程地址与认证**:运行前请先通过 `git clone` 准备好工作目录,并完成 SSH key 或 HTTPS 凭据配置;本工具不替你克隆仓库,也不保存凭据。 ### 克隆与安装 #### Gitee(国内推荐) ```bash git clone https://gitee.com/itgeeker/itgeeker_batch_git_pull_and_push.git cd itgeeker_batch_git_pull_and_push ``` #### GitHub(国际镜像) ```bash git clone https://github.com/alanljj/itgeeker_batch_git_pull_and_push.git cd itgeeker_batch_git_pull_and_push ``` ### 运行 推荐使用 [`uv`](https://docs.astral.sh/uv/) 同步依赖并启动;如果没有 `uv`,请用 `pip` 加本地虚拟环境。 #### uv(跨平台) ```bash uv sync uv run main.py ``` #### pip + venv(Linux / macOS) ```bash python -m venv .venv source .venv/bin/activate pip install -r requirements.txt python main.py ``` #### pip + venv(Windows PowerShell) ```powershell python -m venv .venv .\.venv\Scripts\Activate.ps1 pip install -r requirements.txt python main.py ``` ### 基本使用 1. 启动后,把要管理的本地仓库目录逐条加入主列表;重复路径会被自动检测并提示。 2. 打开「设置」调整提交信息模板、是否在 `commit` 前自动 `git add --all .`,以及点击关闭按钮时是否隐藏到托盘。 3. 点击主界面的「⬇ 批量 git pull」对所有列表目录执行 `git pull`。 4. 点击「⬆ 批量 git push」对每个目录依次执行 `git add --all .`(取决于设置)→ `git commit -m <模板>` → `git push`。 5. 处理完成后会弹出汇总框,告知成功与失败的数量。 > **警告**:默认的批量 `git push` 工作流会在每个列表目录里按顺序执行 `git add --all .`、`git commit -m `、`git push`,从而把工作区里所有已变更的文件一并提交并推送。点击按钮前,请确认每个目标目录里没有意外的新增 / 删除或敏感文件。 --- ## 配置说明 配置采用单个 JSON 文件,进程退出时自动保存,下次启动自动恢复。 | 平台 | 路径 | | --- | --- | | Windows | `%USERPROFILE%\itgeeker_widget_config\config_batch_git.json` | | Linux / macOS | `$HOME/itgeeker_widget_config/config_batch_git.json` | 可保存的偏好:窗口位置与大小、目录列表、提交信息模板(默认 `git push from ITGeeker Batch Git Pull And Push`,可用 `{app_name}` 占位符)、是否在 `commit` 前自动 `git add --all .`、启动时是否最小化到托盘、关闭窗口时是否隐藏到托盘。 如需在多台机器之间共享目录列表,可使用主界面的「保存列表到文件 / Save List to File」与「读取列表文件 / Load List from File」,导出或导入一个简单的 JSON 文件。 --- ## 贡献指南 1. 在 GitHub 或 Gitee 上 Fork 本仓库(任一镜像皆可)。 2. 新建特性分支:`git checkout -b feat/your-feature-name`。 3. 提交改动后,先在本地用 `uv run main.py` 跑一遍主流程,确认行为正常。 4. 把分支推送到你的 Fork 并发起 Pull / Merge Request,说明改动动机、测试方式与涉及的截图或 GIF。 --- ## 开源协议 本项目以 **木兰宽松许可证,第 2 版(Mulan Permissive Software License, v2)** 发布。完整协议文本见仓库根目录的 [`LICENSE`](./LICENSE) 文件。 ### 相关链接 - **ITGeeker 技术奇客官方博客**: - **FreeGeeker 开源专栏**: - **GeekerCloud 奇客罗方智能科技**: --- 由 技术奇客 ITGeeker.net 以 Mulan PSL v2 开源 · Maintained by ITGeeker