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

Re: Checking out orphans with -f

From
MFMartin Fick <mfick@codeaurora.org>
Date
Jan 18, 2012, 22:50 UTC
Message-ID
<201201181550.23792.mfick@codeaurora.org>
In-Reply-To
<7vsjjcljmj.fsf@alter.siamese.dyndns.org>

On Wednesday, January 18, 2012 03:40:36 pm Junio C Hamano wrote:

Show 16 quoted lines
> Martin Fick <mfick@codeaurora.org> writes:
> > I am trying to write some scripts which do various
> > things to a git repo and I have run into a issue where
> > I think that git behavior with respect to orphan
> > branches is potentially
> > 
> > undesirable.  If I type:
> >   git checkout --orphan a
> > 
> > I cannot easily abandon this state
> 
> What do you mean by "abandon"?
> 
> If you want to remove a branch "a" because you do not
> need it, you can check out some other branch and say
> "git branch -D a", no?

Actually, no I can't. I can check out some other branch (assuming I have one), but I cannot then delete a, it appears to already be deleted by virtue of checking out another branch. I like that since I never checked it in, better to clean up the garbage, but why can't I then checkout another orphan to do the same thing?

-Martin
-- 
Employee of Qualcomm Innovation Center, Inc. which is a 
member of Code Aurora Forum
Previous: Martin FickNext: Junio C Hamano
Message 4 of 5 in “Checking out orphans with -f”
  1. Martin FickJan 18, 2012
  2. Junio C HamanoJan 18, 2012
  3. Martin FickJan 18, 2012
  4. Martin FickJan 18, 2012
  5. Junio C HamanoJan 18, 2012

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.