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

Re: git refuses to switch to older branches

From
Junio C Hamano <junkio@cox.net>
Date
Aug 20, 2006, 01:34 UTC
Message-ID
<7vy7tkyyu9.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<ec84gg$p2l$1@sea.gmane.org>
Jakub Narebski <jnareb@gmail.com> writes:
> ... I'm not sure if this is feature or bug that git-checkout
> with file specified (path limit specified?) doesn't need -f

This is definitely a feature we deliberately added long after git-checkout was initially written, in reponse to specific requests from users. Back then the only way to revert to index or HEAD was to "checkout-index -f -q -u -a" or "reset --hard" and it was cumbersome to revert only a single path.

I have been wondering if we wanted to be able to say:
	git checkout HEAD gitweb/

to revert everything under named hierarchy, but we haven't heard user requests for this. This is way more dangerous than my liking so personally I am happy that we do not have it.

Previous: Jakub NarebskiNext: Junio C Hamano
Message 5 of 15 in “git refuses to switch to older branches”
  1. Martin WaitzAug 19, 2006
  2. Jakub NarebskiAug 19, 2006
  3. Junio C HamanoAug 19, 2006
  4. Jakub NarebskiAug 19, 2006
  5. Junio C HamanoAug 20, 2006
  6. Junio C HamanoAug 19, 2006
  7. Petr BaudisAug 19, 2006
  8. Martin WaitzAug 20, 2006
  9. Johannes SchindelinAug 20, 2006
  10. Martin WaitzAug 20, 2006
  11. Johannes SchindelinAug 20, 2006
  12. Josef WeidendorferAug 20, 2006
  13. Alex RiesenAug 20, 2006
  14. Martin WaitzAug 20, 2006
  15. Alex RiesenSep 8, 2006

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.