Sai Kumar
Sai Kumar

Reputation: 328

Visual studio 2019 or GIT is ignoring newly added files in the solution even the file extension is not mention in .gitignore

enter image description here

If you see the image two .cs files are locked and i just added Test.cs file in project and it is started showing as ignored file. Is there any way to make all newly added files automatically added to source control?.

Upvotes: 5

Views: 4270

Answers (3)

MK Vimalan
MK Vimalan

Reputation: 1288

Right-click on the file Select Git => Add Ignored file to source control

enter image description here

Upvotes: 2

RShome
RShome

Reputation: 537

Right click on the file in question > Under the Exclude From Project, select the option "Add ignored file to Source Control"

Upvotes: 4

VonC
VonC

Reputation: 1323803

The "red minus overlay icon in Visual studio's Solution Explorer?" should means "excluded from build", not "ignored by Git".

Double-check in command-line with:

cd /path/to/project
git check-ignore -v -- Test.cs

If it is also ignored, that check-ignore command will give you the exact .gitignore and rule.

Upvotes: 3

Related Questions