【发布时间】:2018-08-03 13:50:11
【问题描述】:
首先,在 Bitbucket 中创建一个名为“test”的(裸)主存储库。
然后,在一个ip为10.0.0.1的节点上创建一个本地的bare master repo:
git clone --bare https://username@bitbucket.org/username/test.git
然后,在 ip 10.0.0.253 的节点上创建一个本地工作 repo:
git clone ssh://username2@10.0.0.1:/home/username2/test.git
因此,10.0.0.x 内的工作流程是:
(1) code on 10.0.0.253
(2) at 10.0.0.253, git push to 10.0.0.1
(3) at 10.0.0.1, git push to Bitbucket
假设在10.0.0.x 之外创建了一个本地工作存储库,比如50.113.23.x,并直接从Bitbucket:
mkdir test
cd test
git clone https://username@bitbucket.org/username/test.git
那里的工作流程:
(1) code on 50.113.23.x
(2) at 50.113.23.x, git push to Bitbucket
现在,您能帮忙评论一下如何将更新从 Bitbucket 存储库拉取到位于 10.0.0.1 的本地裸主存储库吗?以下投诉fatal: This operation must be run in a work tree:
git pull origin master
以下完成,但随后的git log 显示没有来自50.113.23.x 的提交:
git fetch origin master
您能帮忙评论一下这里的解决方法吗?非常感谢!
【问题讨论】: