2

I have received feedback on my first ever programming assignment in Python. In general, it was pretty good but I don't fully understand one point. To mark the assignment my teacher cloned my repo via github. The feedback advised using "an appropriate .gitignore that doesn't upload .gitignore itself".

Can anyone expand on this point for me? Still trying to get familiar with git and don't fully understand gitignore.

mimi
  • 23
  • 5
  • check this https://stackoverflow.com/questions/767147/ignore-the-gitignore-file-itself – Mohammed Elmahgiubi Nov 13 '17 at 23:19
  • 1
    In my experience, you do want your .gitignore file to be tracked in git. You should ask your teacher why they didn't want this to happen. – Alex von Brandenfels Nov 13 '17 at 23:46
  • Not committing .gitignore to the repo is bizarre. All I can think of is the assignment had class-specific advice about that file that maybe you didn't follow. – J_H Nov 14 '17 at 00:33

1 Answers1

3

Each line in the .gitignore file establishes a pattern. When deciding if a file should be ignored, Git looks to see if it matches one of the patterns in the .gitignore file.

If you added the text .gitignore into the .gitignore file, the .gitignore file itself would not be controlled within the Git version control system, and would not get uploaded to a remote repository.

Controlling the .gitignore file within Git is no bad thing, however, in my humble opinion. It means all users of the repository have access to the same configuration.

4Oh4
  • 2,031
  • 1
  • 18
  • 33