"abort: git remote error: refs/heads/master failed to update" when pushing to local clone #236
Comments
Moving refs in non-bare repos can fail. Nothing can be done on the If you want support (rather than reporting a bug or feature request), I On 11/17/2011 12:04 AM, anatoly techtonik wrote:
|
Why are those refs being updated? Could it be a bug with Hg-Git? I didn't do anything complicated - just committed new revision into the clone . |
durin42, something should be done about this. Pushing to non-bare repos is possible. So what if git gets confused about the state of the cwd, that's a problem on the git side. hg-git should push, with warnings about non-bare repos, and let the git side handle its mess. |
No. Pushing into a non-bare repository is something you're supposed to not do. We won't do anything that willfully breaks the Git working copy. |
hg-git is no remedy for Git illness. |
Yeah, using hg-git to use git is like trying to use Google translate to read Don Quixote. |
... Except that Don Quixote is a pleasure to read, in any language. |
@jordigh: If you're cloning into hg from git, could this problem be avoided ("the git way") by simply doing your initial git clone with --bare? e.g. if you're doing: git clone http://path/to/whatever
hg git-clone /local/path/to/git/clone # or whatever the hg command is
... then just change that first line to git clone --bare http://path/to/whatever Is that, perhaps, the bit that's missing? I'm unsure -- I randomly saw you mentioning this on IRC, and I'm unfamiliar with hg-git... I'm just guessing that the above might be helpful to someone (possibly @techtonik) whose primary unfamiliarity is with git, instead. (I.e. attempting to translate what @durin42 says into something concrete and specific enough to hopefully be helpful.) |
Your first assumption is broken. I'm not cloning from git. I happily started on hg. Then I wanted to convert my hg repo to git. In order to do this, I must (correct me if I'm wrong):
Pain in the butt... and all because git made a mess of things. |
man git-init | grep bare On Wed, Apr 4, 2012 at 9:01 AM, jordigh
|
durin42, okay, so you collapsed steps 1 and 2. That still requires 3 steps to do what I wish were a simpler operation. |
I ran into this issue after failing to push gigabytes of commits to a newly initted remote. I didn't want to push that data again, but I found I could convert the repository to a bare one and then manually add a master ref on the remote. First, on the hg clone, resolve the master hash:
Then save the result of that command into the remote in $repo/refs/heads/master. |
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:
Full Traceback:
What should I do now? How to commit this stuff upstream? Can Hg-Git do something about this automatically?
The text was updated successfully, but these errors were encountered: