背景
因?yàn)楣ぷ餍枰グ螅?dāng)前所負(fù)責(zé)的項(xiàng)目較多回官;但是人力緊缺,其中絕大部分項(xiàng)目平時(shí)也不會(huì)去跟進(jìn)迭代搂橙。所以經(jīng)常需要批量拉取最新的代碼查看最新的改動(dòng)歉提。
解決方案
一鍵批量拉取指定文件夾下所有 Git 項(xiàng)目的最新代碼,批量執(zhí)行文件下載地址:
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 - - - - - - - - - - - - - - - - -
參數(shù) | 說明 | |
---|---|---|
path | 必填区转,項(xiàng)目文件夾苔巨,將批量拉取此文件夾下面的所有 Git 項(xiàng)目最新代碼 | |
projects | 可選,指定項(xiàng)目名稱蜗帜,多個(gè)以 ` | ` 分隔 |
版權(quán)聲明
本博客所有的原創(chuàng)文章恋拷,作者皆保留版權(quán)资厉。轉(zhuǎn)載必須包含本聲明厅缺,保持本文完整,并以超鏈接形式注明作者后除和本文原始地址:https://blog.mazey.net/3035.html
(完)