Notes

Ignoring files and folders in Git

Edit on GitHub

Git & Github

Create a global .gitignore

1touch ~/.gitignore_global
2git config --global core.excludesfile ~/.gitignore_global
  • foo/ will match a directory but not a file or symbolic link
  • foo without the / is a glob pattern
  • **/foo will match a file or directory anywhere

Remove files that are ignored now but are still in the Git repo

1git rm -r --cached node_modules
2git commit -m 'Remove the now ignored directory node_modules'
3git push origin master