Use the .gitignore file, note that you might have to exclude files with
git rm --cached filename
from tracking, which were put there before you added the rule for them, see https://help.github.com/articles/ignoring-files
Вопрос
I have a folder in my Git directory that stores information about when my program runs and I don't want this information to keep getting added to the repo.
Currently I just avoid selecting files from this folder in the git gui. This can be very cumbersome however as there are often a lot of them. What is the best way to do this either using the gui or the command line?
Решение
Use the .gitignore file, note that you might have to exclude files with
git rm --cached filename
from tracking, which were put there before you added the rule for them, see https://help.github.com/articles/ignoring-files
Другие советы
Put the path to that directory into the .gitignore
file, like this:
echo 'ignored-files/' >>.gitignore
Put the .gitignore
file under version control if other developers might want to ignore those files as well.