Git - clone 仓库拷贝

274 阅读1分钟

Git - clone 仓库拷贝

克隆old仓库到本地 --bare

git clone --brae old.git

在 git 上新建一个远程仓库 new.git

镜像推送的方式推送 克隆仓库代码old 到 新仓库new

进入克隆的本地仓库old
cd old.git

以镜像推送的方式推送本地仓库old到新的远程远程new git push --mirror new.git

删除本地克隆仓库old

cd ../

rm -rf old.git

克隆新仓库new到本地

git clone new.git