-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Explain that gitignore only work on new files, and provide a guide on how to untrack.
Use some of this text:
In fact, .gitignore only affect new files. So if you were to commit and push to the cloud a file called fileA.do but then you realize that file should not be shared, then adding a specific rule in .gitignore to ignore any file called fileA.do is not enough to remove that file, because that file is already what is called tracked. There is a way to fix that if you ever run in to that. I don't have a guide for that written up at this point, but let me know if you run in to this and I can help you with that.
Also important to note, if you were to un-track a file and then ignore it, the commit were you initially committed the file is in the history and the history is accessible for anyone with access to the repository. Deleting single commits in history is kind of possible but likely to lead to errors, so the most common solution is to delete the whole repository with all history and start fresh. But that is only a desirable solution if the content of the file is really sensitive.