dotnet new gitignore not creating .gitignore file

Viewed 398

I am using Visual Studio 2019

I am trying to create .gitignore in NuGet Package Manager Console, but I find no .gitignore shown in the Visual Studio and the root folder.

> dotnet new gitignore

Getting ready...
The template "dotnet gitignore file" was created successfully.


> ls

my_server
my_server.sln


> dotnet new gitignore

Creating this template will make changes to existing files:
  Overwrite   .gitignore

2 Answers

I also tried same command : dotnet new gitignore and I successfully created .gitignore file but you can not see by : ls command you can go to inside that folder where you run this command : dotnet new gitignore you will find .gitignore file is present there don't worry. it will work fine. : ls command can't find with '.extension' file it should have file name to find file name.

to see .gitignore file you should use : ls -a command to see .gitignore file

Finally Figured it out.

Right click your solution in Visual Studio > Display Options > Select Show all files

.gitignore will then appear

Related