我如何更新裸露回购? [英] How do I update my bare repo?

查看:80
本文介绍了我如何更新裸露回购?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个裸仓库来发布我的仓库,但我无法弄清楚如何用主仓库的当前状态更新裸仓库。

解决方案

如果您想复制主回购库中的所有对象,请在主回购库内执行以下操作:

  git push --all<裸露回购网址> 

或者,在裸露的回购库中执行提取操作:

  git fetch< url-of-main-repo> 

您不能进行拉取操作,因为拉要合并 HEAD ,这是一个裸露的回购没有的。



您可以将这些添加为遥控器以节省您未来打字的时间:

  git remote add&any-name> < URL-的-其他回购> 

然后您可以简单地执行

  git push --all< whatever-name> 

  git fetch< whatever-name> 

取决于您所处的回购情况。如果< whatever-name> ; origin ,你甚至可以把它完全保留。



免责声明:我不是git guru。如果我说错了什么,我想要开悟!

更新:阅读评论


I created a bare repo to publish my repository, but I can't figure out how to update the bare repo with the current state of the main repository.

解决方案

If you want to duplicate all the objects from the main repo, do this inside the main repo:

git push --all <url-of-bare-repo>

Alternatively, do a fetch inside the bare repo:

git fetch <url-of-main-repo>

You cannot do a pull, because a pull wants to merge with HEAD, which a bare repo does not have.

You can add these as remotes to save yourself some typing in the future:

git remote add <whatever-name> <url-of-other-repo>

Then you can simply do

git push --all <whatever-name>

or

git fetch <whatever-name>

depending on what repo you're in. If <whatever-name> is origin, you can even leave it out altogether.

Disclaimer: I'm not a git guru. If I said something wrong, I'd like to be enlightened!

Update: Read the comments!

这篇关于我如何更新裸露回购?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆