Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong comment line (gitignore) #133

Closed
ghost opened this issue Jul 9, 2016 · 3 comments
Closed

Wrong comment line (gitignore) #133

ghost opened this issue Jul 9, 2016 · 3 comments
Labels

Comments

@ghost
Copy link

ghost commented Jul 9, 2016

2
With set: commentchar = ";"

@npostavs
Copy link
Contributor

npostavs commented Jul 9, 2016

https://git-scm.com/docs/gitignore does not say the gitignore files are affected by the commentchar setting. AFAICT, they are not.

@ghost
Copy link
Author

ghost commented Jul 11, 2016

You seriously?

@npostavs
Copy link
Contributor

Here's a demo. You can see that even though commentChar is ;, # continues to be the comment syntax for .gitignore.

$ git status
On branch master
Untracked files:
  (use "git add <file>..." to include in what will be committed)

        #strange-file
        ;strange-file

nothing added to commit but untracked files present (use "git add" to track)
$ git config core.commentChar
;
$ echo '#strange-file' >> .gitignore
$ echo ';strange-file' >> .gitignore
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   .gitignore

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        #strange-file

no changes added to commit (use "git add" and/or "git commit -a")

@tarsius tarsius closed this as completed Aug 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants