简体   繁体   中英

Adding Existing Visual Studio 2013 Projects to Git source control

Hi I'm trying to add my source code from a couple of Solutions that I have.

I have installed Visual Studio 2013.

In one of my Solutions I have 22 projects.

When I try "Add Solution to Source Control" I get the following message:

The current solution has projects that are located outside the solution folder. These projects will not be source controlled in the Git repository. To add all the projects to a single Git repository please consolidate all projects under a single folder.

So do I have to move all my projects into the Solution folder?

Many of my Projects are used by more than one Solution, so I'd rather leave the file structure that I have alone. Would it not mess my existing Solutions up anyway if I did that?

Or is there another way to add individual projects into source control?

Or have I made some fundamental error in my understanding of source control?

Thanks

Or is there another way to add individual projects into source control?

You may avoid using the Visual Studio interface and instead use Git directly to add your individual projects to source control. If you are using Github or something, please read the related instructions first. eg https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

I had this with Visual Studio 2017. I had created a new repo in GitHub and cloned locally where I created the following structure:

.\\solution\\ .\\solution\\AcmeSolution\\ .\\solution\\AcmeSolution\\src\\ .\\solution\\AcmeSolution\\src\\Acme.Lib\\ .\\solution\\AcmeSolution\\src\\Acme.Lib\\Acme.Lib.csproj .\\solution\\AcmeSolution\\src\\Acme.Lib\\SomeClass.cs .\\solution\\AcmeSolution\\test\\ .\\solution\\AcmeSolution\\test\\Acme.Lib.Tests\\ .\\solution\\AcmeSolution\\test\\Acme.Lib.Tests\\Acme.Lib.Tests.csproj .\\solution\\AcmeSolution\\test\\Acme.Lib.Tests\\SomeClassTests.cs .\\solution\\AcmeSolution\\AcmeSolution.sln

For me I had TortoiseGit installed. It was as simple as doing right click on the .\\solution\\ folder and selecting Add from the context menu. It had selected the appropriate files - no bin files or DLLs.

Back in Visual Studio (without any restarting) all the files were ready to commit to GitHub .

This might work for you in 2013 - I don't know if you sorted it, but may help others in future.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM