Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Guidelines for hosting VisualStudio projects on github

I'd like to host some of my C# VisualStudio 2010 projects on github. I'm guessing that it's good practice to at least add a minimal .git/info/exclude file. For my FluentWpf project, I've got this in my exclude file:

FluentWpf/bin/*
FluentWpf/obj/*

Are there any other best practices to follow before checking my projects into git?

like image 773
dharmatech Avatar asked May 07 '12 20:05

dharmatech


2 Answers

You can use GitHub's default .gitignore for it:

https://github.com/github/gitignore/blob/master/VisualStudio.gitignore

like image 51
Pedro Nascimento Avatar answered Oct 21 '22 18:10

Pedro Nascimento


If you happen to use Git Extensions, it has its own default .gitignore. In Visual Studio just go to Git menu->Edit .gitignore and click "Add default ignores".

Before making the initial commit I think it's also a good idea to decide on how you're going to treat line endings.

As you probably know, Windows uses a combination of CR-LF ASCII characters to denote the end of a line, while UNIX systems use an LF character alone. If your project is going to be developed only on Windows, I don't think it makes any sense to use the UNIX endings, so I would make sure the core.autocrlf option is set to false. If your project is going to be edited both on Windows and a UNIX system, you may set it true - then the repository will internally store all line endings as LF characters, but files on your disk will contain CRLF.

These are at least the choices I would make, someone else might do differently. Whichever option you choose, CHOOSE IT NOW, because changing it later may be problematic.

Git Extensions allow you to change this option in GUI: Git->Settings->Global/Local settings tab, "Line endings" groupbox.

Make sure all developers in your team have the same setting on their machines.

like image 40
kamilk Avatar answered Oct 21 '22 20:10

kamilk