Adding file to git Ignore in flutter

2,747

Solution 1

I suspect you added the key.properties line to .gitignore after that file had been committed.

What you need to do is the following:

git rm --cached key.properties

**/android/key.properties should be added to .gitignore!

Solution 2

Adding file in .gitignore there is some step


If file is not exist in folder

1) then create file then add into .gitignore


If file is already exist so you want to add in .gitignore

1) delete file (Before backup)

2) commit deleted file.

3) add file name into .gitignore

4) commit .gitignore file

Share:
2,747
Admin
Author by

Admin

Updated on December 21, 2022

Comments

  • Admin
    Admin over 1 year

    I'm working on making the flutter app and I'm trying to add my "key.properties" file, which includes passwords, into git ignore file. In my android/.gitignore file, I wrote

    gradle-wrapper.jar
    /.gradle
    /captures/
    /gradlew
    /gradlew.bat
    /local.properties
    GeneratedPluginRegistrant.java
    /key.properties
    

    like this and I thought it makes key.properties file ignored on my git hub, but when I push the code, I still can see it on GitHub. Is the way I write correct??