代码之家  ›  专栏  ›  技术社区  ›  James

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

  •  15
  • James  · 技术社区  · 15 年前

    我试图让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]
    
    3 回复  |  直到 15 年前
        1
  •  43
  •   StayOnTarget Charlie Flowers    7 年前

    尝试发出命令 hg bookmark -f master

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

    再推一次。

    Hg-Git pushes your bookmarks up to the Git server as branches 将Git分支拉下来并设置为书签。(来自官方README.md)

        2
  •  2
  •   James    15 年前

    就在我问了这个问题之后,我做了一个小小的改变。这是捡起来推的。因此,为了让hg git接受它,您似乎必须等到做出了新的承诺。

        3
  •  0
  •   Phasmal    12 年前

    hg merge 因为其中一个有书签。

    为了推动工作,我必须:

    • 根据配置hg git和github remote https://blog.glyphobet.net/essay/2029
    • 从github中提取并更新
    • 强制合并(检查要与哪个id一起使用 hg heads ),
    • 提交合并
    • 在文件中添加一个小的更改(在末尾添加一个空格字符),
    • 那么,提交
    • 将书签移到提示处

    最后命令如下(替换为 <x> 截面图)

    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
    

    请确保您为上面的合并选择远程修订-如果您不这样做,它不会工作!

    推荐文章