A note on GIT's .gitignore

Here's an excerpt from Nick Quaranto's "Ignoring Files" article. I tend to forget this all the time.

Two things to keep in mind with ignoring files: First, if a file is already being tracked by Git, adding the file to .gitignore won’t stop Git from tracking it. You’ll need to do git rm --cached to keep the file in your tree and then ignore it. Secondly, empty directories do not get tracked by Git. If you want them to be tracked, they need to have something in them. Usually doing a touch .gitignore is enough to keep the folder tracked.

...that did helped me. And thanks to him.

Bookmark and Share


Post a Comment

Hi there! Please leave your message here. Also, I may not be able to respond to your query right away. So please bear with me. Thanks. :)