Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git ignore push only

Tags:

git

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.

like image 640
Nicolas Trichet Avatar asked Sep 24 '12 13:09

Nicolas Trichet


1 Answers

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).

like image 170
Michael Durrant Avatar answered Nov 07 '22 23:11

Michael Durrant