简体   繁体   中英

hiding files using gitignore

I want to hide the node_modules folder and a javascript file in git,for which I added the following in .gitignore file:

          node_modules/
          database.js/

After that,in git bash I added the following commands

          git rm -r --cached .
          git add .
          git commit -m "hide files"
          git push origin master

But I was able to hide only node_modules folder and not the js file.Please don't mistake me, I am a newbie to git. What is my mistake here?Can anybody help? Thank you

You have a trailing slash behind database.js

database.js/

It should simply be

database.js

Please refer to the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM