Reputation: 4281
I have made a C# Project and Initialized it via git bash shell.Now we know that git should be only tracking source files for that I have added a .gitignore file and in it typed the following regular expressions.
!*.cs
!*.resx
Then I committed my .gitignore file My question is that Is my approach right?
Upvotes: 0
Views: 1545
Reputation: 78653
That seems woefully incomplete - we recommend that you add your project files (.csproj
) to version control as well. You would also want to add any resources that are required. In fact, it's much easier to exclude the files you don't want, like temporary files and user-specific data, rather than trying to include the files you do want.
As a result, we recommend that you use the community's VisualStudio.gitignore
file as the .gitignore
for Visual Studio projects.
If you use Visual Studio to initialize your repository, it will add this file for you.
Upvotes: 2