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

[HELP] A local branch has disappeared

From
Johnny Lee <johnnylee194@gmail.com>
Date
Jan 19, 2009, 03:54 UTC
Message-ID
<488807870901181954p558756f5v94c8a6681125e8bb@mail.gmail.com>
Hi all,
Today I found my current branch (named cupcake) has disappeared.
git@tomato:~/golf$ git branch -a
  htc_cupcake
  tmo_cupcake
  origin/HEAD
  origin/cupcake
  origin/device
As you can see, there is no "*" to mark the current branch.

But when I check the HEAD, it still pointed to the cupcake branch git@tomato:~/golf$ cat .git/HEAD ref: refs/heads/cupcake

But when I check the ref/heads, the cupcake is missing git@tomato:~/golf$ ls .git/refs/heads/ htc_cupcake tmo_cupcake

And the cupcake in still in the config:
git@tomato:~/golf$ cat .git/config
[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
        sharedRepository = 1
[remote "origin"]
        url = /home/rick/golfresort/device/.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "cupcake"]
        remote = origin
        merge = refs/heads/cupcake
I'm confused:
1. I didn't do any aggressive operations. Why the branch has
disappeared? Normally I have done these operation for this repo:
   i. pull from parent repo
   ii. cloned by children repo
   iii. pulled by children repo
   iv. pushed from children repo
2. Is there any way to resume the cupcake branch? Can I manually add
the cupcake to ref/heads?

Thanks very much for your considerations, Johnny

-- 
we all have our crosses to bear
Next: Neil Macneale
Message 1 of 3 in “[HELP] A local branch has disappeared”
  1. Johnny LeeJan 19, 2009
  2. Neil MacnealeJan 19, 2009
  3. Johnny LeeJan 19, 2009

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.