10

Is there a way with git to ignore local changes to a file but continue tracking it into the remote repo ? I wan't to fetch but not push a file.

In my case, I want the .project eclipse file to be committed the first time on the "master" repo, but the dev team doesn't have to push changes made by eclipse plugin.

Nicolas Trichet
  • 204
  • 2
  • 9
  • possible duplicate of [git ignore files only locally](http://stackoverflow.com/questions/1753070/git-ignore-files-only-locally) – Hauleth Sep 24 '12 at 13:03

1 Answers1

2

Though not an official way, this is the workflow we use:

Rename and add add .example at the end of the filename.

Add the actual filename to your .gitignore file (and commit the .gitignore file).

Locally, copy the file to a copy that has the actual filename (now being ignored).

Michael Durrant
  • 93,410
  • 97
  • 333
  • 497