1 Star 4 Fork 1

李栋/pgit

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

pgit

pgit 是 Proxy Git 的缩写,使用镜像加速 github 下载,支持 repo,release

仓库

李栋/pgit

安装

github下载

curl -o pgit https://raw.githubusercontent.com/gcslaoli/pgit/main/shell/pgit && chmod +x pgit && sudo mv pgit /usr/local/bin

gitee下载

curl -o pgit https://gitee.com/gcslaoli/pgit/raw/main/shell/pgit && chmod +x pgit && sudo mv pgit /usr/local/bin

使用

对于git clone加速,使用pgit替代git.

pgit会自动判断是否需要加速,如果需要加速,则会自动使用镜像地址.传入的参数与git完全一致,事实上内部使用的也是git.

pgit clone https://github.com/cool-team-official/cool-admin-vue.git

当需要通过wget或者curl下载 relase branch raw 等资源时,可以使用pgit加速.在原wget或者curl命令前加上pgit即可.

例如cool-tools的 wget 安装脚本为:

wget -O cool-tools https://github.com/cool-team-official/cool-admin-go/releases/latest/download/cool-tools_$(go env GOOS)_$(go env GOARCH) && chmod +x cool-tools && ./cool-tools install  && rm ./cool-tools

可以使用pgit加速:

pgit wget -O cool-tools https://github.com/cool-team-official/cool-admin-go/releases/latest/download/cool-tools_$(go env GOOS)_$(go env GOARCH) && chmod +x cool-tools && ./cool-tools install  && rm ./cool-tools

配置

pgit默认使用的镜像地址为https://ghproxy.com/,如果需要使用其他镜像地址,可以设置环境变量PGIT_PREFIX来指定.

例如使用https://gh.hjmcloud.cn/:

export PGIT_PREFIX=https://gh.hjmcloud.cn/

自建镜像

如果需要自建镜像,可以使用开源项目gh-proxy来搭建.

MIT License Copyright (c) 2022 LiDong Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

使用镜像加速github下载,支持repo,release 展开 收起
Shell
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gcslaoli/pgit.git
git@gitee.com:gcslaoli/pgit.git
gcslaoli
pgit
pgit
main

搜索帮助