I'm trying to put an existing project under Git source control, but I'm unclear on several things.
I have set up a 'Team Foundation Service' Git account online.
I currently have an ASP.NET MVC 4 solution - in my Projects folder. I have created a Git 'repository' locally (an empty folder currently). Should this just be my current application folder in Projects? Or does it need to be a copy?
How do I get my existing files into the online repository?
Open the command palette with the key combination of Ctrl + Shift + P . At the command palette prompt, enter gitcl , select the Git: Clone command, and press Enter. When prompted for the Repository URL, select clone from GitHub, then press Enter.
I went searching around for a similar question - the way I've managed to initialize a Git repository for an existing project file is this (disclaimer: this is done in Visual Studio 2013 Express, without a Team Foundation Server setup):
That did it for me - assuming Git is set up for you, you can go to menu View → Team Explorer, then double click the repository for your project file, and make your initial commit (making sure to add whatever files you'd like).
git init
in the solution folder. That is the proper way to create a repository folder..gitignore
file, so you don't commit unnecessary stuff.git add
git commit
git remote add origin <proper URL>
git push
your codeAlternatively, there are detailed guides here using the Visual Studio integration.
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