I want to use Git for some personal projects I work on. I'm new to git and don't know how to start...
Should I first create the project (say an ASP.NET MVC application) in Visual Studio and then turn the folder that is created into a repository, or should I create a repository first and then create the project inside that folder?
Also, are there any best-practises for how to structure the folders inside the "repository root folder"?
These are my two questions right now, but any pointers to articles etc for best-practises using Git and Visual Studio are welcome!
Start with Git & GitHub in Visual Studio Or, you can work locally with no provider at all. To get started using Git with Visual Studio: If you have a Git repo hosted on a Git provider like GitHub, clone the repository to your local machine. Otherwise, easily create a new Git repository and add your code.
You shouldn't store credentials like usernames, passwords, API keys and API secrets. If someone else steals your credentials, they can do nasty things with it.
Git repositories are so lightweight that it doesn't really matter whether you create the project and then create the repo or create the repo and add the folders. You will anyway be doing a git add
and git commit
after the folders have been created.
But, for me, I usually create the project from VS and restructure the folders so that at the root there is the src
folder and the .sln
and project files are within the src folder. VS would typically create the root folder with the project name which I rename to src. Then I create the repo, add the standard .gitignore
and .gitattributes
and commit the repo.
See my preferred structure here: https://github.com/manojlds/cmd
Of course, you can have whatever structure you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With