git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: unable to push

From
Ddavid@lang.hm <david@lang.hm>
Date
Jun 1, 2008, 18:28 UTC
Message-ID
<alpine.DEB.1.10.0806011125340.15294@asgard.lang.hm>
In-Reply-To
<20080601182205.GA742@sigill.intra.peff.net>
On Sun, 1 Jun 2008, Jeff King wrote:
Show 10 quoted lines
> On Sat, May 31, 2008 at 09:10:26AM -0700, david@lang.hm wrote:
>
>> I created localmaster in an attempt to get things working again. I'll try
>> creating a new master branch... that does make it work again, thanks.
>>
>> what I'm not understanding completely is how I broke things in the first
>> place.
>
> I'm not understanding that, either. You not only created localmaster,
> but you deleted master. Did you maybe do a "git branch -m"?

in the public repo I had never created a 'master' branch. I had just done a clone, setup git daemon, and pushed to it.

at some point several days later I found that my push didn't work and that I wasn't on any branch in the public repo. in reading the man page for git branch I saw the --track option, so I created the localmaster branch to try and get things working.

Show 24 quoted lines
>> going back through .git/logs/HEAD it looks like I did a checkout HEAD^^^
>> and never properly recovered. should I have done a checkout master to get
>> things back on track? I had thought that I could do a checkout of an old
>> version, modify it, do a commit, and the commit would go on top of the old
>> HEAD and I could just keep going (the reason for doing this instead of a
>> reset is that I had already published the intermediate commits to the
>> public repo, so I didn't want to roll back the history, just get the old
>> version of one of the files)
>
> I think you did eventually "recover" which is to say you ended up on the
> localmaster branch. When you did a checkout of HEAD^^^, your HEAD became
> "detached", meaning that you were no longer on any branch, but at a
> specific commit (and there should have been a warning message mentioning
> that).
>
> When you make commits on a detached HEAD, your HEAD remains detached,
> meaning that those commits are not on any branch. So when you did a
> checkout back to some actual branch, those commits were "lost" (meaning
> that no branch contains them, but they are still available by peeking
> through the reflog).
>
> But that shouldn't have had anything to do with the state of the master
> branch; once you detached, you were purely operating on the detached
> HEAD.
that explains things.
David Lang
Previous: Jeff KingNext: Jeff King
Message 6 of 11 in “unable to push”
  1. david@lang.hmMay 31, 2008
  2. Jeff KingMay 31, 2008
  3. david@lang.hmMay 31, 2008
  4. Jeff KingJun 1, 2008
  5. Jeff KingJun 1, 2008
  6. david@lang.hmJun 1, 2008
  7. Jeff KingJun 1, 2008
  8. david@lang.hmJun 1, 2008
  9. Jeff KingJun 1, 2008
  10. Adam PiątyszekMay 31, 2008
  11. Jeff KingJun 1, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.