Git Gitignore

jasonlarkin edited this page Aug 20, 2012 · 5 revisions


Gitignore is a useful tool to let git know to ignore certain files or patterns of files. Simply go into your repo folder (e.g. ~/ntpl) and create .gitignore. Add any files you don't want in plain text on a new line to let git know you want to ignore them, e.g.:


Global gitignore

Gitignore can also be used on a global scale, and this is how the ntpl repo is kept clean. First, in your home directory (~) create a file .gitignore_global. Then add the following three lines to it:


Any files that match this pattern won't be recognized by git and therefore will not be uploaded to the repo (and will make your "git status" command a lot cleaner). Next, run this command: "git config --global core.excludesfile ~/.gitignore_global". This will add the file to your config. And you're done! Remember, you can still create custom .gitignore files in any of your subdirectories. To learn more about the issue see this page.

##ignore any directory with given name

##cleaning your ./.git folder

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.