Ignoring files by .gitignore

2

I use GitLab as a repository for a Android project. I want to ignore the files in the openCVLibrary320 folder at commit/push time. I typed the folder as follows in the file .gitignore :

*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
/openCVLibrary320

I changed any file within the openCVLibrary320 folder. When giving commit it was to ignore this file, but it appears to be committed.

What should I do?

    
asked by anonymous 30.03.2017 / 13:37

1 answer

5

If the file / folder already exists in the repository, you can not just put it in gitignore , you also need to remove it from the repository. In other words, you have to tell the GIT to stop "watching" the file / folder in question.

The comano for this is the rm --cached <file> , in your case, stay like this

git rm --cached openCVLibrary320/
    
30.03.2017 / 14:07