schacon/hg-git — Issue #236: "abort: git remote error: refs/heads/master failed to update" when pushing to local clone
Author: techtonik
Created: 2011-11-17 06:04:19+00:00
State: open

I am not a Git expert, that's why I use Mercurial + Hg-Git. But it doesn't make your life easier, because you still have to look for workarounds for Git errors like this one.

I fetched openFrameworks repository (which is huge) using Git, then cloned it locally with Hg, made commits and tried to push back into local repository, but it failed:

```sh
$ hg push
pushing to /home/user07/p/openFrameworks
creating and sending data
abort: git remote error: refs/heads/master failed to update
```

Full Traceback:

```python
$ hg push --traceback --debug -v
pushing to /home/user07/p/openFrameworks
creating and sending data
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 87, in _runcatch
return _dispatch(req)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 679, in _dispatch
cmdpats, cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 454, in runcommand
ret = _runcommand(ui, options, cmd, d)
File "/usr/lib/python2.7/dist-packages/mercurial/extensions.py", line 182, in wrap
return wrapper(origfn, *args, **kwargs)
File "/usr/lib/python2.7/dist-packages/hgext/color.py", line 368, in colorcmd
return orig(ui_, opts, cmd, cmdfunc)
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 733, in _runcommand
return checkargs()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 687, in checkargs
return cmdfunc()
File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 676, in
d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
File "/usr/lib/python2.7/dist-packages/mercurial/util.py", line 385, in check
return func(*args, **kwargs)
File "/usr/lib/python2.7/dist-packages/mercurial/commands.py", line 3884, in push
newbranch=opts.get('new_branch'))
File "/home/user07/p/hg-git/hggit/hgrepo.py", line 22, in push
git.push(remote.path, revs, force)
File "/home/user07/p/hg-git/hggit/git_handler.py", line 227, in push
changed_refs = self.upload_pack(remote, revs, force)
File "/home/user07/p/hg-git/hggit/git_handler.py", line 704, in upload_pack
raise hgutil.Abort(_("git remote error: ") + str(e))
Abort: git remote error: refs/heads/master failed to update
abort: git remote error: refs/heads/master failed to update
```

What should I do now? How to commit this stuff upstream? Can Hg-Git do something about this automatically?