Reputation: 102
I added a folder to .gitignore and some files went missing in the system, they were PDF files and since I understand binary files should not be in git I added the folder containing those files in .gitignore. I though it would not affect the existing files in the systems but some of them are not in the server anymore.
Could it be due to me adding .gitignore? Or should I discard this possibility?
Upvotes: 0
Views: 91
Reputation: 22262
No, adding files to .gitignore merely tells git that the files shouldn't be added to the system using git add
for example (without -f
at least) and git status
will not show you that they are untracked.
However, because they're untracked you may lose status about them and may forget that they're important. Thus, if you delete your cloned copy of a repository that has the PDFs in them, then you've just deleted them yourself and have forgotten that they weren't part of the checked in files. Thus, you and other users that clone the repository won't get access to them.
If you're interested in storing large files in git
, you might look at git annex
and git lfs
, which offers ways to store and share large files.
Finally, my general thought on PDFs and similar large files: it's best if your repository can self-generate them during a build or similar process. If not, then you do need to track them in a versioning system somehow to ensure they're not lost (hence: git annex
or git lfs
).
Upvotes: 1