git remote add --mirror = fetch与git clone --mirror会做相同的仓库吗?

欧尼尔

如果我想复制一个仓库,我可以使用它。

git clone --mirror $SRC $DST

但是此命令不需要位于的回购$DST通常没关系,但是如果我想从多个进程中同时发出Git命令,可能会导致某些竞争状况,因为在执行命令之前不存在可锁定的文件对象。

如果我只想跳过存在测试$DST,我想我可以做

mkdir -p $DST
cd $DST
git init --bare 
git remote add origin --mirror-=fetch $SRC 2>/dev/null || true
git remote update

这样会产生完全相同的回购git clone --mirror $SRC $DST吗?

如果查看对进行的测试git clone --mirror,则将看到镜像克隆是具有以下内容的一个:

  • fetch的Refspec设置为+refs/*:refs/*
  • 一个git config --bool remote.origin.mirror设置为true

如果在您的git remote命令之后满足了这些条件,那么可以,这等效于镜像克隆。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

git clone --mirror危险吗?

如何更新git clone --mirror?

我可以从本地 git mirror clone 结帐分支吗

Git在`git clone --mirror`之后注意到丢失

git clone --mirror和pull有什么区别

如何在JGit中执行“ git clone --mirror”?

如何打开git clone --mirror生成的存储库

git clone --mirror和git clone --bare有什么区别

git push --mirror可以创建一个新的仓库吗?

Git push --all vs --mirror

“ git fetch <url>”和“ git add remote remote <url>”后跟“ git fetch上行”有什么区别?

“ git remote add origin”仅显示“ git remote add”的用法

brew upgrade git fetch error,但是回购可以用git clone下载吗?

git push --mirror和git set-url之间的区别

仓库迁移到Gerrit,git push --mirror返回refs / meta / config(无法删除项目配置)

运行“ git clone [email protected]”时如何提供用户名和密码?

无法使用git clone git:// ...克隆仓库-好的,可以使用git clone http://

git remote add with other SSH port

git remote add引发致命错误

git remote update和fetch之间的区别?

git push --mirror-内部服务器错误

git push --mirror给出“无法推送一些引用”

创建新的git分支。git remote add有什么意义?

什么是“ git remote add ...”和“ git push origin master”?

在python脚本中运行“ git clone https://remote.git”时,如何提供密码(带有@)?

ssh git clone超时

git clone 的存储效率

如何更新git clone?

git worktrees与“ clone --reference”