【问题标题】:How to git clone from *local bare* repository如何从 *local bare* 存储库 git clone
【发布时间】:2016-08-16 08:52:09
【问题描述】:

假设我的本地计算机上有一个裸存储库./new-bare.git。 将它克隆到我机器上另一个位置的正确方法是什么?

【问题讨论】:

  • @frlan 不同的问题 - 我指的是从裸存储库克隆,如标题中所强调的那样
  • 裸/非裸不应该有任何区别

标签: git git-clone git-bare


【解决方案1】:

从非裸仓库克隆没有区别:

/tmp> mkdir foo
/tmp> git init --bare foo 
Initialized empty Git repository in /tmp/foo/
/tmp> git clone /tmp/foo /tmp/baa
Cloning into '/tmp/baa'...
warning: You appear to have cloned an empty repository.
done.

【讨论】:

  • 我对@9​​87654322@ 的使用有点困惑,但我想你的答案适用于我的简单案例。 10X
【解决方案2】:
git clone path_to_new-bare.git new_destination

【讨论】:

  • 值得一提的是,这似乎只在文件夹名称以.git 结尾时才有效(如示例中所示)。除此之外,比接受的答案要好得多,谢谢:)
猜你喜欢
  • 2012-11-07
  • 2022-06-11
  • 2019-09-16
  • 2011-11-09
  • 2016-09-30
  • 2021-09-01
  • 2018-01-17
  • 1970-01-01
  • 2012-09-03
相关资源
最近更新 更多