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

Re: git reset --hard w/o touching every file

From
Jeff King <peff@peff.net>
Date
Nov 2, 2008, 03:33 UTC
Message-ID
<20081102033313.GB4936@coredump.intra.peff.net>
In-Reply-To
<geicn8$ss8$1@ger.gmane.org>
On Sat, Nov 01, 2008 at 04:03:50PM -0400, Edward Z. Yang wrote:
Show 5 quoted lines
> Pierre Habouzit wrote:
> > git checkout HEAD -- <list of the files>
> 
> What if I do not know a priori which files *do* need to be updated? Is
> there a command that I can get this information from? Also, I may not

Sorry, I don't quite understand. You want to check out some subset of files, but you don't know which subset?

Try "git status" or "git diff" to look at which files have changes?
Or maybe we didn't understand your original question.
> necessarily be checking out HEAD.
Doing
  git checkout v1.5 -- <list of files>
or using any other ref will work just fine.
-Peff
Previous: Edward Z. YangNext: Edward Z. Yang
Message 4 of 6 in “git reset --hard w/o touching every file”
  1. Edward Z. YangNov 1, 2008
  2. Pierre HabouzitNov 1, 2008
  3. Edward Z. YangNov 1, 2008
  4. Jeff KingNov 2, 2008
  5. Edward Z. YangNov 2, 2008
  6. Jeff KingNov 2, 2008

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.