I wish to stop tracking files but still keep them in my working tree.
I’ve gathered that git rm --cached FILE will let me do that. However, if someone else pulls this change, will their local copies be deleted?
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, their copies will be automatically deleted. Imagine if this deletion wouldn’t happen–then working copies of all users would be polluted with piles of deleted files, which aren’t needed anymore.
However, if the remote users made local changes to these files, they won’t be deleted, since
pullwill result in a merge conflict.As Jefromi suggests in his comment, while the files are removed at the other users’ sides, they can easily be restored–they’re under a version-control, aren’t they? 😉 Files could be gotten by
git checkout <revision> -- <files...>. As revision you may specify the id of the previous commit, for pull it’s saved inORIG_HEAD(see this question for details):