Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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.:
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