Re: Problem with a push

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Mon, 11 Jun 2007, Alex R.M. Turner wrote:
> 
> I get the following error when pushing after a merge:
> 
> updating 'refs/heads/master'
>   from c18f9e4350c26e6b45d0a282ff32991784becbdd
>   to   39b7d927720c9f2810e0af5311975119c0d7c7bd
> updating 'refs/remotes/origin/HEAD'
>   from 1e631edb3078ec3a4d1fa598c8f410f6a61659b0
>   to   c18f9e4350c26e6b45d0a282ff32991784becbdd
> updating 'refs/remotes/origin/master'
>   from 1e631edb3078ec3a4d1fa598c8f410f6a61659b0
>   to   c18f9e4350c26e6b45d0a282ff32991784becbdd

Ok, pushing out remote branches is a bit odd in the first place. As in 
"you probably shouldn't do that". The "remote" branches are really local 
to each repo, and updating them by pushing is really quite suspect.

So the regular "master" branch pushed out fine:

> refs/heads/master: c18f9e4350c26e6b45d0a282ff32991784becbdd -> 39b7d927720c9f2810e0af5311975119c0d7c7bd

and that part is all ok.

However, I think the problem is this:

> refs/remotes/origin/HEAD: 1e631edb3078ec3a4d1fa598c8f410f6a61659b0 ->  c18f9e4350c26e6b45d0a282ff32991784becbdd

You updated the HEAD file, but that actually is a _symbolic_ ref, which 
normally points to refs/removes/origin/HEAD, and that in turn explains the 
other errors:

> ng refs/remotes/origin/master failed to lock
> error: Ref refs/remotes/origin/master is at c18f9e4350c26e6b45d0a282ff32991784becbdd but expected 1e631edb3078ec3a4d1fa598c8f410f6a61659b0
> error: failed to lock refs/remotes/origin/master
> error: failed to push to 'ssh://aturner@xxxxxxxxxxxxxxxxxx/data/git/mls'

What happened is that the "remotes/origin/master" branch already got 
updated when you updated HEAD, so now git is complaining that you are 
trying to update it again, but it no longer has the same value that it had 
originally (since you changed it).

> but when I try it again, it just says Everything up-to-date.

Right. Because the HEAD update really already did all the changes (to 
_both_ remotes/origin/HEAD _and_ remotes/origin/master, since it was a 
symref), so next time around there is nothing to push, and you won't see 
this issue any more.

So I don't think there was anything reall bad going on, except for the 
fact that you really shouldn't try to push out remote branches.

What was the command line?  In particular, was this a "git push --all" or 
something? I think we should make sure that we do *not* push remotes by 
default (and if you really *really* want to push remotes, you'd have to 
specify them explicitly).

			Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux