I've read the docs on this several times over and I still don't completely get the differences between these different commands. Maybe it's just me, but the documentation could be more lucid:
http://git-scm.com/docs/gitignore
https://help.github.com/articles/ignoring-files
Moreover, a lot of the commentary on this subject seems to use the words "indexed", "committed", "tracked" somewhat loosely, which makes the differences between these three less clear.
My current (admittedly limited) understanding:
Files matched in
.gitignorewill not be tracked in the future. (Though they may have been tracked previously.) This means that they won't ever show up in a futuregit statuslist as changed. However, future changes will still be synced with remote repos. In other words, the files are still "indexed", but they are not "tracked". Because a.gitignorefile is in the project directory, the file itself can be versioned.Files matched in
.git/info/excludewill also not be "tracked". In addition, these files will not ever be remotely synced, and thus will never be seen in any form by any other users. These files should be files that are specific to a single user's editor or workflow. Because it is in the.gitdirectory, theexcludefile can't itself be versioned.Files that have had
assume-unchangedrun on them also don't show up ingit statusorgit diff. This seems similar toexclude, in that these files are neither "indexed" nor "tracked". However, the last version of the file to be committed beforeassume-unchangedwill remain visible to all users in the repo.
My questions:
Is the above interpretation correct? Please correct me.
If a file has already been in a commit, what is the functional different between matching it in
.excludeand runningassume-unchangedon it? Why would one prefer one approach to another?My basic use case is that I want to avoid sorting through diffs on compiled files, but I still want those compiled files synced along with the source files. Will a
gitignore'd file still be pushed? If not, how to manage final deployment of the compiled files?