Is there a way to "freeze" a file in Git?

Posted by Suan on Stack Overflow See other posts from Stack Overflow or by Suan
Published on 2011-01-17T05:25:01Z Indexed on 2011/01/17 5:53 UTC
Read the original article Hit count: 229

Filed under:
|
|
|
|

I'm in a situation where I want to open source my project, however there's a single source file that I want to release a "clean" version of, but use a separate version locally. Does git have a feature where I can just commit a file once, and it stops looking for changes on that file from now on?

I've tried adding the file to .gitignore, but after the first time when I do a git add -f and git commit on the file, and I proceed to edit it again, git status shows the file as changed. The ideal behavior would be for git to not show this file as changed from now on, even though I've edited it.

I'd also be interested in how others have dealt with "scrubbing" their codebases of private code/data before pushing to an open source repo, especially on Git.

© Stack Overflow or respective owner

Related posts about git

Related posts about file