Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

vsts new repo has a gitignore option for many platforms/languages but not .net/c#

I noticed that VSTS has an "Add a .gitignore" dropdown with many different platforms/languages options for selection. For example, I could select the option of "Ruby" which I'm assuming would provide a default filter for all file types in a compiled Ruby project which should generally not be checked in to a git repo. However, no option exists in the dropdown for .NET/C#. Does VSTS include some type of equivalent gitignore file within C#/.NET files by default? Or is there some type of default global filter build into VSTS which enforces this?

like image 859
user10067458 Avatar asked Jul 18 '18 18:07

user10067458


People also ask

How do I add a Gitignore to an existing repository in Visual Studio?

Open Visual Studio and the solution needing an ignore file. From the top menu select Git > Settings. The above will open Visual Studio's Options with Source Control > Git Global Settings selected. From the list on the left select Git Repository Settings and then click the Add button for Ignore file.

Should I add Gitignore to repo?

Normally yes, . gitignore is useful for everyone who wants to work with the repository. On occasion you'll want to ignore more private things (maybe you often create LOG or something. In those cases you probably don't want to force that on anyone else.

Can you have multiple Gitignore files?

gitignore file is a plain text file where each line contains a pattern for files/directories to ignore. Generally, this is placed in the root folder of the repository, and that's what I recommend. However, you can put it in any folder in the repository and you can also have multiple . gitignore files.

How to add Git ignore to the VSTs repository?

@user10067458 If you did not initialize the VSTS git repo by adding .gitignore file in VSTS web page, you can add it manually by yourself by touch .gitignore, and then copy the content ( github.com/github/gitignore/blob/master/VisualStudio.gitignore) in your .gitignore file.

How do I create or edit a gitignore file for my Repo?

You can create or edit your .gitignore file for your repo by going to the Settings view in Team Explorer, then selecting Repository Settings. Select Edit for your .gitignore.

Does Visual Studio have a gitignore file?

This means that a .gitignore file will work regardless of how you choose to interact with the repo. Within Visual Studio, from the command line, from SourceTree, it's all the same. right but my question was if vsts (or vs) will gen one by default for .net/c# projects.

How do I stop gitignore from syncing with Visual Studio?

To stop tracking the files in the gitignore file; Open a command prompt and navigate to the directory that contains your solution file (.sln), then run the following commands (first two commands contains dot at last): git rm -r --cached. git add. git commit -am "Remove ignored files" Then open your Visual Studio and sync your repo.


1 Answers

The .gitignore template for C# is called "Visual Studio".

like image 137
Daniel Mann Avatar answered Sep 30 '22 01:09

Daniel Mann