关于git:批量拉取git-pull-指定文件夹下面所有-Git-项目的最新代码

2次阅读

共计 953 个字符,预计需要花费 3 分钟才能阅读完成。

背景

因为工作须要,以后所负责的我的项目较多;然而人力紧缺,其中绝大部分我的项目平时也不会去跟进迭代。所以常常须要批量拉取最新的代码查看最新的改变。

解决方案

一键批量拉取指定文件夹下所有 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

(完)

正文完
 0