I have a .gitignore file with the following contents:
.vs/
I run the following commands
git add .gitignore
git commit -m 'adding ignore file'
In my .vs folder, I have a text file named test.txt.
When I type git status
, I see the following output
On branch master
Untracked files:
(use "git add <file>..." to include in what will be committed)
.vs/
nothing added to commit but untracked files present (use "git add" to track)
What am I missing here?
Found my solution here (Visual Studio was adding Chinese characters to my .gitignore also)
My .gitignore was saved with unicode encoding.
This is because I created my .gitignore file via PowerShell like so
".vs/" > .gitignore
I did this because explorer doesn't let you create a text file with a leading period. My solution:
".vs/" | Out-File -Encoding ascii -FilePath .gitignore