Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6959619
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:17:44+00:00 2026-05-27T15:17:44+00:00

I’m trying to use hg push to a git repository, but it silently fails.

  • 0

I’m trying to use hg push to a git repository, but it silently fails. I found a single post on the mailing list and a registered hg-git issue, but both are about half a year old without much activity. So I started to think I misunderstand/misconfigure something.
My ~/.hgrc contains

[extensions]
hgext.bookmarks =
hgext.git =
#hggit = /path/to/hg-git-0.3.1/hggit
[bookmarks]
track.current = True

This snippet reproduces the problem:

mkdir /tmp/Git
cd /tmp/Git
git init
echo 'something' > myfile
git add .
git commit -m 'Started'
cd ..
hg clone /tmp/Git /tmp/Hg
cd /tmp/Hg
echo 'another thing' >> myfile
hg ci -m 'Working'
hg log
# Two items listed
hg push
cd ../Git
git log
# Only one item listed, but two expected

I tried both hg-git 0.2.6-2 shipped with Ubuntu 11.10, and the latest tagged version, 0.3.1. My mercurial is version 1.9.1

I even tried two proposed workarounds, hg update master before commiting, and hg bookmark -f master after commiting, but both gave an error.

UPDATE:

I created a new issue for this

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T15:17:45+00:00Added an answer on May 27, 2026 at 3:17 pm

    There are two issues here: push should explicitly fail, and hg-git should report it (but it doesn’t).

    Pushing should fail, giving "abort: git remote error: refs/heads/master failed to update" when pushing to local clone, because it’s a push to a non-bare repository (see more on that from a mercurial user’s perspective). A working version of the above snippet is this (note the use of the Bare repository).

    mkdir /tmp/Git
    cd /tmp/Git
    git init
    echo 'something' > myfile
    git add .
    git commit -m 'Started'
    cd ..
    git clone --bare -l /tmp/Git /tmp/Bare
    hg clone /tmp/Bare/ /tmp/Hg
    cd /tmp/Hg
    echo 'another thing' >> myfile
    hg ci -m 'Working'
    hg log
    # Two items listed
    hg push
    cd ../Bare
    git log
    # Two items listed
    

    Regarding, why hg-git hides this error, I suspect it’s a problem with the most recent versions shipped with Ubuntu. What I did was

    apt-get remove mercurial-git python-dulwich
    easy_install hg-git
    

    It removed dulwich 0.7.1, and installed 0.8 which is required according to the hg-git site. Now, it works for me. The mercurial version (1.9.1) seems to work fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm trying to create an if statement in PHP that prevents a single post
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to render a haml file in a javascript response like so:
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.