0

I've been trying to write some comments on my .gitignore file. I started the comments with # but the sentences don't change into comments. How can I solve this?

My .gitignore file looks like this:

# this is a comment 

db/* .sqlite3
pwc
  • 7,043
  • 3
  • 29
  • 32
tg_so
  • 496
  • 6
  • 11

2 Answers2

4

According to the documentation

A line starting with # serves as a comment. Put a backslash ("\") in front of the first hash for patterns that begin with a hash.

Whether your editor provides syntax highlight or not, # at the line start denotes a comment

Lol4t0
  • 12,444
  • 4
  • 29
  • 65
  • I use sublime text, but it doesn't turn the sentences into comments. – tg_so Nov 25 '15 at 21:35
  • 1
    Then it is an issue with syntax highlighting in sublime. Obviously, there is no configuration to colorize `.gitignore`-files. But that is not a problem, since git will handle them as comments anyway. – SevenEleven Nov 25 '15 at 21:48
1

Could it be, that you added sqlite before adding the entry to the. gitignore file?

You have to remove the file from the repo with

git rm --cached db/*.sqlite3

then commit the remove. It will be ignored afterwards.

JDurstberger
  • 4,127
  • 8
  • 31
  • 68