如何将更新从Bitbucket的远程(裸)主仓库提取到本地裸主仓库?

时间:2018-02-23 13:29:35

标签: git bitbucket git-bare

首先,一个(裸)主仓库,名称为" test"是在Bitbucket中创建的。

然后,在具有ip 10.0.0.1

的节点上创建本地裸主存储库
git clone --bare https://username@bitbucket.org/username/test.git

然后,在具有ip 10.0.0.253的节点上创建本地工作仓库:

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

您可以在这里评论解决方法吗?非常感谢!

1 个答案:

答案 0 :(得分:1)

git fetch origin master:master

即。明确更新本地master

相关问题