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

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

From
Edward Z. Yang <edwardzyang@thewritingpot.com>
Date
Nov 2, 2008, 04:36 UTC
Message-ID
<gejanr$os$1@ger.gmane.org>
In-Reply-To
<20081102033313.GB4936@coredump.intra.peff.net>
Jeff King wrote:
> Sorry, I don't quite understand. You want to check out some subset of
> files, but you don't know which subset?
Yeah, I should elaborate a little.

I'm using a script to automatically update a website with the contents of a Git repository at a specified interval. While I could use git pull, I've been told that it's safer to do a git fetch, and then a git reset --hard remotes/master, because the former could trigger a merge and on a live website that is NOT desirable.

Unfortunately, since Git touches all files on a reset --hard, it's causing problems with the smart cache system, which checks whether or not the cache file is older than the source file, and regenerating if it is.

Cheers, Edward

Previous: Jeff KingNext: Jeff King
Message 5 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.