Visual Studio (2017) - Git With Common Projects

时间:2017-08-14 07:05:31

标签: git version-control visual-studio-2017

I have a few common projects on my solution. This means that i use them from other solutions too and i combined these common projects inside a common solution.

For example :

*Common.sln has CommonProject.csproj

*MySolution1.sln has ProjectA.csproj, ProjectB.csproj, CommonProject.csproj

*MySolution2.sln has ProjectX.csproj, ProjectY.csproj, CommonProject.csproj

I use git for source controller. (Bitbucket repos)

My problem is Git doesn't track my common projects on my solution1 and solution2.

Thanks for helps

1 个答案:

答案 0 :(得分:0)

那是因为CommonProject.csproj并不存在于本地存储库中。 solution1solution2的路径。

您似乎在CommonProject.csprojsolution1中添加了solution2添加 - >现有项目。但通过这种方式,CommonProject.csproj仍然位于Common.sln下。

因此,您应该将CommonProject.csproj复制到solution1solution2目录下,然后使用新路径添加项目。或者您应该添加包含Common.sln的仓库作为solution1solution2的git子模块。