create gitignore
# creates gitignore file
$ touch .gitignore
how to use gitignore to ignore a folder
You can ignore entire directories, just by including their paths and putting a / on the end:
1
2
node_modules/
logs/
How to ignore files in git
Then in Git Bash you have to write the following line:
git config --global core.excludesfile ~/.gitignore_global
--------------------------------------------------------------------
If the repository already exists then you have to do the following:
git rm -r --cached .
git add .
git commit -m ".gitignore is now working"
If the step 2 doesn’t work then you should write the whole route of the files that you would like to add.
how to put files into gitignore
$ echo debug.log >> .gitignore
$ git rm --cached debug.log
rm 'debug.log'
$ git commit -m "Start ignoring debug.log"
git ignore not saving changes
git rm -rf --cached .
git add .
how to git ignore a file
git config --global core.excludesfile ~/.gitignore_global
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us