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

Re: `git checkout --orpan` leaves a dirty worktree

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 8, 2013, 20:12 UTC
Message-ID
<7vzjzezhrr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130208200402.GB8461@google.com>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 20 quoted lines
> Ramkumar Ramachandra wrote:
>
>> Why should I have to `git rm -rf .` after a `git checkout --orphan`?
>> What sort of misfeature/ incomplete feature is this?
>
> One designed for the "going open source" use case, where you have
> existing code that you want to put into a new branch without history.
> When there is no existing code, it seems simpler to do
>
> 	cd ..
> 	git init code-that-has-nothing-to-do-previous-cwd
> 	cd code-that-*
> 	... hack hack hack ...
> 	git commit
> 	git remote add origin <url>
> 	git push -u origin master
>
> BTW, I suspect a clearer way to say what you meant is "Sounds like a
> misfeature" which is gentler and more focused than an implied "What
> kind of idiot designed this?"  Even if you are thinking the latter. :)
So true ;-).  

Especially when you may an answer that may make _you_ look like an idiot ;-)

Previous: Jens LehmannNext: Martin von Zweigbergk
Message 6 of 8 in “`git checkout --orpan` leaves a dirty worktree”
  1. Ramkumar RamachandraFeb 8, 2013
  2. Jonathan NiederFeb 8, 2013
  3. Ramkumar RamachandraFeb 8, 2013
  4. Junio C HamanoFeb 8, 2013
  5. Jens LehmannFeb 10, 2013
  6. Junio C HamanoFeb 8, 2013
  7. Martin von ZweigbergkFeb 8, 2013
  8. Ramkumar RamachandraFeb 8, 2013

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.