0

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?

kostix
  • 51,517
  • 14
  • 93
  • 176
rwolst
  • 12,904
  • 16
  • 54
  • 75
  • 1
    You can read more about [gitignore at the docs](https://www.kernel.org/pub/software/scm/git/docs/gitignore.html). –  Jul 14 '13 at 17:57

2 Answers2

6

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

mvw
  • 5,075
  • 1
  • 28
  • 34
2

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.

Alberto Zaccagni
  • 30,779
  • 11
  • 72
  • 106