<
Git bare mirror 复制仓库
>
上一篇

Repo 的 manifest
下一篇

安装 更新 repo 工具

复制仓库



创建仓库的裸克隆

git clone --bare https://github.com/exampleuser/old-repository.git

镜像推送至新仓库

cd old-repository.git
git push --mirror https://github.com/exampleuser/new-repository.git

Mirroring a repository that contains Git Large File Storage objects

创建仓库的裸克隆

git clone --bare https://github.com/exampleuser/old-repository.git

拉取仓库的 Git Large File Storage 对象

git lfs fetch --all

镜像推送至新仓库

git push --mirror https://github.com/exampleuser/new-repository.git

将仓库的 Git Large File Storage 对象推送至镜像

git lfs push --all https://github.com/exampleuser/new-repository.git

Mirroring a repository in another location

创建仓库的裸镜像克隆

git clone --mirror https://github.com/exampleuser/repository-to-mirror.git

设置到镜像的推送位置

cd repository-to-mirror.git
git remote set-url --push origin https://github.com/exampleuser/mirrored

设置推送 URL 可简化至镜像的推送。 如需更新镜像,请获取更新和推送

git fetch -p origin
git push --mirror
Top
Foot