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

Question about removing changes from the index

From
GHGustav Hållberg <gustav@gmail.com>
Date
Feb 6, 2009, 13:57 UTC
Message-ID
<a1e915350902060557m5a67eba0q819c2ba2a0a49c21@mail.gmail.com>

I'm wondering if there's anyone who can recommend a smart way to "reset" the index entry for individual files to the contents of HEAD, in effect, removing any previous change between HEAD and the index (for those files).

I'm aware that 'git gui' lets you do this (in a human-friendly way) but I want to do this from a script (and am not concerned about the human-friendliness, as long as it's not too programmer-unfriendly).

Thanks, Gustav

Next: Björn Steinbrink
Message 1 of 5 in “Question about removing changes from the index”
  1. Gustav HållbergFeb 6, 2009
  2. Björn SteinbrinkFeb 6, 2009
  3. Gustav HållbergFeb 6, 2009
  4. Matthieu MoyFeb 6, 2009
  5. Sitaram ChamartyFeb 6, 2009

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.