I have a gitignore file in root directory and its not working. Using source tree with Bitbucket.
Asked
Active
Viewed 463 times
-1
-
You will need to commit your gitignore first before it'll work. – Bjorn Sep 18 '17 at 13:40
-
@Chris I do not use cmd for git mate, so I can't understand what to do. I use sourcetree. – Waleed Sep 18 '17 at 13:45
-
@Bjorn, that's not correct. `.gitignore` files don't have to be committed to take effect. (Though it's a good idea to commit them anyway; that's their purpose: to be a shared ignore mechanism. Private ignores can go into `.git/info/exclude`.) – ChrisGPT was on strike Sep 18 '17 at 13:48
-
@Waleed, then tag your question with the SourceTree tag. It's probably a good idea to learn enough Git to understand the proposed duplicate, though. This question has been asked and answered hundreds of times on Stack Overflow. It doesn't need to be asked again. – ChrisGPT was on strike Sep 18 '17 at 13:51
1 Answers
1
For those who are using Bitbucket and not the commands with git. You need to right click on the file while committing and choose option 'Stop Tracking'. This will stop tracking this file as long as it is in gitignore. Once you remove gitignore it will start tacking again.
Git tends to not ignore files that are already committed to a repository. So you need to ignore them explicitly, if using Bitbucket use stop tracking option.

Waleed
- 1,097
- 18
- 45