0

I have a project where I have to do some changes to one file to get it working on a specific machine. This file is part of the repository and I don't want the file to be committed and uploaded to master unless i specifically tell it so. I want that or I want a command or option that I have to execute before committing and pushing so that the changes does not get uploaded to master.

Is this possible?

4

2 回答 2

2

Since you said the file is already in the repository, the specific command that you want to not track changes to the specific file is

git update-index --assume-unchanged filename.ext

where filename.ext is the name of your specific file.

于 2013-03-30T22:30:53.870 回答
0

This is a good reference with examples. The only problem I've run into is ignoring directories, be sure to include the trailing slash.

于 2013-03-30T22:27:59.123 回答