Search code examples
gittemporary-filesgit-addhidden-filesdotfiles

avoid git adding dotfiles, hidden file and tempfiles


I'm new to Git and I use this command before committing:

git add .

and it adds some files I don't want to be tracked like: temp files

.tmp_basictest-barchart.html.84279~
.tmp_basictest-demo.html.84399~ 

and hidden files:

.project

How to avoid these files to be added ?


Solution

  • Make a file called ".gitignore" and add the filenames to it. .gitignore should be in your root directory, but you can use it in any directory (like an ".htaccess" file).