I have some object files and assembly files that I have committed for the first version. I don't want to commit changes to these files as I make changes to my project and update the other source files. However, I do want to keep them in my repository, in the first commit.
The two options I know of are:
Remove them from the repository:1
a. Update .gitignore
b.git rm --cached <file>
or...git update-index --assume-unchanged <file>
2
Both of these can be seen in this question: Ignore files that have already been committed to a Git repository
and here:
Git: ignore specific file(s) both on Commit and Pull
1 ...However, I'd like them to stay within the repository and they will be removed when the next commit is completed.
2 ...This option, as per this answer from this question notes:
Assume-unchanged should not be abused for an ignore mechanism. It is "I know my filesystem operations are slow... Especially, it is not a promise by Git that Git will always consider these paths are unmodified... it reserves the right to report that the path has been modified (as a result, "git commit -a" is free to commit that change).
So is there a proper way to commit those files once, keep them in that state in the repository, and then ignore any further changes to them?
I did find some information here: https://gist.github.com/canton7/1423106
But it seems... involved. Is there no actual option that git contains that works as though --assume-unchanged does, but without lying to git?