使用 hg-git 时不会推送任何更改

发布于 2024-09-28 01:34:51 字数 264 浏览 5 评论 0原文

我试图让 hg-git 扩展在 Windows 下工作,经过几个小时的摆弄,我终于让它工作了。然而,即使 hg Push 的输出显示为:

importing Hg objects into Git
creating and sending data
    github::refs/heads/master => GIT:8d946209
[command completed successfully Wed Oct 20 15:26:47 2010]

I'm trying to get the hg-git extension working under Windows and after hours of fiddling, I finally seem to have it working. However, nothing shows up in my git repository even though the output of hg push reads:

importing Hg objects into Git
creating and sending data
    github::refs/heads/master => GIT:8d946209
[command completed successfully Wed Oct 20 15:26:47 2010]

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

无人问我粥可暖 2024-10-05 01:34:51

尝试发出命令 hg bookmark -f master

(使用 -f 强制移动现有书签)

,然后再次尝试推送。

这是有效的,因为 Hg-Git 将您的书签作为分支推送到 Git 服务器 并将拉取 Git 分支下来并将它们设置为书签。 (来自官方README.md)

Try issuing the command hg bookmark -f master

(use -f to force an existing bookmark to move)

Then try pushing again.

This works because Hg-Git pushes your bookmarks up to the Git server as branches and will pull Git branches down and set them up as bookmarks. (from the official README.md)

临走之时 2024-10-05 01:34:51

而且似乎就在我问完这个之后,我做了一个微不足道的改变。这个东西被捡起来推了推。所以看来你必须等到你做出新的提交才能让 hg-git 接受它。

And it seems that just after I asked this, I made a trivial change. This was picked up and pushed. So it seems that you have to wait until you've made a new commit in order for hg-git to pick it up.

小兔几 2024-10-05 01:34:51

我选择“使用自述文件初始化此存储库”。这意味着我最终得到了两个头,我无法hg merge,因为其中一个有书签。

为了让推送工作,我必须:

这最终得到如下命令(替换 部分),

hg pull github
hg update
hg merge <revision-id-of-incoming-git-version>
hg addremove
hg commit -m 'merged with github'
 # make some trivial change to a file - eg add a space where it doesn't cause harm
hg add <changed-file>
hg commit -m 'trivial change'
hg bookmark -f master
hg push github

确保您选择远程修改上面的合并 - 如果你不这样做,它就不起作用!

I had chosen to 'Initialize this repository with a README'. This meant I ended up with two heads, which I couldn't hg merge because one had a bookmark.

To get pushing working, I had to:

  • configure hg-git and github remote as per https://blog.glyphobet.net/essay/2029
  • pull from github and update
  • force the merge (checking which id to use with hg heads),
  • commit the merge
  • add a trivial change to a file (add a space char to the end),
  • commit, then
  • move the bookmark to the tip
  • push to my configured github remote

This ended up with commands as follows (substituting in <x> sections)

hg pull github
hg update
hg merge <revision-id-of-incoming-git-version>
hg addremove
hg commit -m 'merged with github'
 # make some trivial change to a file - eg add a space where it doesn't cause harm
hg add <changed-file>
hg commit -m 'trivial change'
hg bookmark -f master
hg push github

make sure you pick the remote revision for the merge above - if you don't it doesn't work!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文