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

Re: Use of the -f flag on checkout

From
Matthias Urlichs <smurf@smurf.noris.de>
Date
Sep 29, 2005, 07:09 UTC
Message-ID
<pan.2005.09.29.07.09.51.516956@smurf.noris.de>
In-Reply-To
<200509290754.30017.alan@chandlerfamily.org.uk>
Hi, Alan Chandler wrote:
> What is the risk in not using it (ie what are the cases when you should
> use it)?

The risk of using it is that you kill your local changes, even if you want to keep them. They're *gone*.

The risk of not using it is that you check local changes into a branch where they don't belong.

=> IMHO, "checkout -f" should be avoided in scripts. If you want to be safe, check that you don't have local changes or additional files *before* doing the work.

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
To me, home is not rooms and places. It is the people I want to be with.
		-- FJ van Wingerde
Previous: Alan ChandlerNext: Junio C Hamano
Message 4 of 7 in “Pull from one branch to another?”
  1. Jeff GarzikSep 29, 2005
  2. Junio C HamanoSep 29, 2005
  3. Use of the -f flag on checkoutAlan Chandler, Sep 29, 2005
  4. Matthias UrlichsSep 29, 2005
  5. Junio C HamanoSep 29, 2005
  6. Junio C HamanoSep 29, 2005
  7. Tony LuckSep 29, 2005

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.