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

Re: getting git to ignore modifications to specific files

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Sep 2, 2010, 10:20 UTC
Message-ID
<4C7F7A57.4030504@drmicha.warpmail.net>
In-Reply-To
<4C7EA1FF.8030307@gmail.com>
Chris Packham venit, vidit, dixit 01.09.2010 20:57:
Show 23 quoted lines
> Hi,
> 
> We have a git repository that as some GNU build system (a.k.a.
> autotools) files, my current problem is with the INSTALL file but I
> suspect there may be some others. These can get modified if you are
> running a different version of autotools from when the files were created.
> 
> I've had various arguments about which autotools files should or
> shouldn't be included in our repositories. My general rule of thumb is
> that if it is automatically generated then it shouldn't go into the
> repository.
> 
> There are a couple of repositories that are local clones of 3rd party
> repositories which have included the pesky auto-generated files so whle
> I can remove the offending files from repositories we control I need
> another solution for the 3rd part ones.
> 
> I did a bit of googling and found
>   git update-index --assume-unchanged
> 
> Which works locally to stop git status from complaining. Is there anyway
> for me to make a change to our clone (a .gitattribues entry?) so that
> everyone can get this by default?
For tracking my git configuration including .gitk, I used
[filter "dotgitk"]
        clean = fgrep -v geometry
together with an appropriate attribute for gitk.

I don't know how your autogenerated files differ, but maybe you can set up a filter (or custom diff driver) which makes git think the files are equal though they are not, just like in my case (ignoring window geometry changes for gitk).

Michael
Previous: Jan KrügerNext: Chris Packham
Message 8 of 9 in “getting git to ignore modifications to specific files”
  1. Chris PackhamSep 1, 2010
  2. Joshua JensenSep 1, 2010
  3. Bruce KorbSep 1, 2010
  4. Chris PackhamSep 1, 2010
  5. Joshua JuranSep 1, 2010
  6. Jonathan NiederSep 2, 2010
  7. Jan KrügerSep 2, 2010
  8. Michael J GruberSep 2, 2010
  9. Chris PackhamSep 2, 2010

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.