背景
因爲工作需要,當前所負責的項目較多;但是人力緊缺,其中絕大部分項目平時也不會去跟進迭代。所以經常需要批量拉取最新的代碼查看最新的改動。
解決方案
一鍵批量拉取指定文件夾下所有 Git 項目的最新代碼,批量執行文件下載地址:
https://github.com/mazeyqian/go-gin-gee/releases/tag/v1.1.0
Example 1: MacOS batch-git-pull.sh
#!/bin/bash
./batch-git-pull-mac-darwin-amd64 -path="/Users/X/Web"
Output:
2023/01/24 23:01:36 Git pull...
2023/01/24 23:01:36 projectPath: /Users/X/Web
2023/01/24 23:01:36 assignedProjects: .
2023/01/24 23:01:42 result: - - begin - -
...
...
- - end - - - - - - - - - - - - - - - - -
Example 2: Linux batch-git-pull.sh
#!/bin/bash
chmod u+x ./batch-git-pull-linux-amd64
./batch-git-pull-linux-amd64 -path="/Users/X/Web" -projects="go-gin-gee|mazey"
Output:
2023/01/24 23:12:02 Git pull...
2023/01/24 23:12:02 projectPath: /Users/X/Web
2023/01/24 23:12:02 assignedProjects: go-gin-gee|mazey
2023/01/24 23:12:06 result: - - begin - -
...
...
- - end - - - - - - - - - - - - - - - - -
參數 | 說明 |
---|---|
path | 必填,項目文件夾,將批量拉取此文件夾下面的所有 Git 項目最新代碼 |
projects | 可選,指定項目名稱,多個以 ` |
版權聲明
本博客所有的原創文章,作者皆保留版權。轉載必須包含本聲明,保持本文完整,並以超鏈接形式註明作者後除和本文原始地址:https://blog.mazey.net/3035.html
(完)