Shell/Bash: git update gitignore Example


Shell/Bash Example: This is the "git update gitignore" Example. compiled from many sources on the internet by

git update gitignore

git rm -r --cached .
git add .
git commit -m "update gitignore"

reinit gitignore

# rm all files
git rm -r --cached .
# add all files as per new .gitignore
git add .
# now, commit for new .gitignore to apply
git commit -m ".gitignore is now working"

gitigore rm cache

git rm -r --cached .

git add gitignore

$ touch .gitignore

remove gitignore files

git ls-files --ignored --exclude-standard -z | xargs -0 git rm --cached
git commit -am "Remove ignored files"

// answer from: thSoft

* Summary: This "git update gitignore" Shell/Bash Example is compiled from the internet. If you have any questions, please leave a comment. Thank you!