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

Ignoring local changes

From
PPazu <pazu@pazu.com.br>
Date
Dec 14, 2006, 16:26 UTC
Message-ID
<loom.20061214T171948-279@post.gmane.org>

Is there any way to make git completely ignore changes to certain local files? I know about .gitignore, but that doesn't work when the files I want to ignore were already added to the repository.

A little more context should help you understand my need. I'm currently tracking a big subversion repository using git-svn; I do all my develop on local git branches, and later use git-svn dcommit to push these changes to the svn repository.

There are some files in the svn repository (and by extension, on my local mirrored repository) that are almost always locally modified (eclipse/IDEA project files or generated artifacts that someone else added to svn), but I almost never want to commit then. This is a hassle in several situations:

1) git-status always show these files as modified, polluting the output and
making it harder for me to pinpoint the "real" changes.
2) git-rebase refuses to run, since the working copy will always be dirty*
3) since git-svn dcommit uses git-rebase, sometimes it fails for the same reason.
So, is there any way to make git look the other way regarding these files?
* I usually get around this making a local commit with the local modifications,
rebasing, and the using git-reset to revert the last commit.
-- Pazu
Next: Andreas Ericsson
Message 1 of 7 in “Ignoring local changes”
  1. PazuDec 14, 2006
  2. Andreas EricssonDec 14, 2006
  3. PazuDec 14, 2006
  4. Rogan DawesDec 14, 2006
  5. PazuDec 14, 2006
  6. PazuDec 14, 2006
  7. Johannes SchindelinDec 15, 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.