How could I avoid git of downloading specified some files from main repository? I would like to exclude some javascript files that I don’t want to be on the webserver.
Is there any “gitignore” that prevents download of specific files?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, you can do this with the “sparse checkout” feature.
Edit the
.git/info/sparse-checkoutfile and add:Then:
This should make the
invisible.jsfile disappear from the working directory (and it won’t come back on an update).See the “Sparse checkout” section of the
git read-treedocumentation for more information.