gitphpstormbitbucketgitignoregitkraken

.gitignore isn't ignoring my files


I'm currently using BitBucket for my repos with the git engine. I'm not using github since is a private project, so I can't set it public.

When I create my .gitignore file with gitignore.io, trying to ignore PhpStorm and WebStorm, Gitkraken (which is my git client on Mac) it isn't ignoring the .idea folder. And each time I change my workspace layout opening or closing a sidebar or a file, then git is tracking that change. I can't figure out what's wrong, since I've also tried to set .idea/ in .gitignore, but the files inside it are still tracked...

Any ideas?


Solution

  • Update your .gitignore file. For instance, add one more folder for those you want to untrack in .gitignore: foldername.

    To stop tracking a file, you need to remove it from the index. This can be achieved with the below command.

    Remove all tracked files, including wanted and unwanted:

    git rm --cached .
    

    then

    All files will be added to track, excluding those in .gitignore:

    git add .