如何为多个.NET解决方案设置单个GIT存储库 [英] How can a single GIT repository be set up for multiple .NET Solutions

查看:100
本文介绍了如何为多个.NET解决方案设置单个GIT存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试为我们正在开发的系统建立一个GIT存储库。我想要一个单一的存储库,但希望通过.NET中的解决方案将前端应用程序与后端服务分开。我希望能够分别拉出前端代码和后端代码。



我试图通过GIT网站向GIT团队发送电子邮件,地址为 http:/ /git-scm.com/community 。电子邮件地址是git@vger.kernel.org。不幸的是,我的纯文本电子邮件被网站拒绝了。



有没有人能成功建立一个像我需要的git存储库?

I am trying to set up a GIT repository for a system we are developing. I desire a single repository, but want to separate the front end applications from the back end services by solutions in .NET. I want to be able to pull the front end code and the back end code separately.

I tried to email the GIT team per the GIT web site at http://git-scm.com/community. The email address is git@vger.kernel.org. Unfortunately, my plain-text email was rejected by the site.

Is there anyone out there that has successfully set up a git repository like my needs?

推荐答案

在开发代码时,你并不是很清楚这个代码是如何管理的,但是我假设你正在使用Visual Studio 2013并希望在同一个代码下添加这两个解决方案git repo。



简短的回答是,这是无法做到的。如果您要在Visual Studio 2013中管理代码,请不要这样做。 1解决方案= 1个存储库,总是。



这样,VS中的git处理与你使用TFS不同,后者允许你按工作区管理代码。 Git使用了不同的假设。



也就是说,有两个不同的回购没有坏处。因为这是你对待项目的方式,所以有不同的回购是有意义的。



但是,如果你必须在同一个git仓库中有两个解决方案,你的方式这样做是为了不使用VS来管理源代码控制。相反,您可以将两个解决方案放在同一个父文件夹中。



然后你可以使用第三方工具(如SourceTree)将git源代码控制应用于该父文件夹。



这将要求您使用SourceTree等来管理您的提交和遥控器,如果您有很多人在同一个仓库上工作,这将变得笨拙。但它是可行的。



我最好的建议:只需使用两个不同的回购。无论如何,那是你的发展模式。不要篡改成功。
You're not being really clear on how this code is managed when you develop it, but I am presuming you are using Visual Studio 2013 and want to add both solutions under the same git repo.

Short answer is, that can't be done. Not if you are going to manage your code in Visual Studio 2013, anyway. 1 solution = 1 repository, always.

In that way, git handling in VS is different than had you used TFS, which allows you to manage code by workspaces. Git uses a different assumption.

That said, there's no harm in having two different repos. Since that's the way you treat the project, it makes sense to have different repos.

However, if you MUST have both solutions in the same git repo, the way you would do that is to not use VS to manage the source control. Instead, you would put both solutions in the same parent folder.

Then you would apply git source control to that parent folder using a third-party tool, such as SourceTree.

This would require you to use SourceTree or the like to manage your commits and remotes, and would become unwieldy if you have a lot of people working on the same repo. But it is doable.

My best advice: Just use two different repos. That's your development pattern, anyway. Don't tamper with success.


GIT存储库与VS解决方案没什么特别之处。 GIT项目只是具有所有内部内容的目录(粗略地说),并且修订控制系统(不仅仅是GIT)跟踪此目录中的每个基本更改(某些文件可以过滤为不相关的,例如非源文件)。就这样。在里面,你可以有任意数量的解决方案和解决方案目录,项目和项目目录,任何东西。



看,不是很明显:应该保留修订控制系统与文件和目录的内容无关,以及编程实体,程序目录,文件和其他项目工件,应该与跟踪其源的过程无关,表现得好像只有一个版本?



-SA
GIT repository has nothing special to do with VS Solutions. A GIT project is just the directory with all its inner content (roughly speaking), and the Revision Control System (not only GIT) tracks each and every essential change in this directory (some files can be filtered out as unrelated, such as non-source files). That's all. Inside, you can have any number of solutions and solution directories, projects and project directories, anything.

Look, isn't it obvious: Revision Control System should be kept agnostic to the content of files and directories, and the programming entities, program directories, files, and other project artifacts, should be agnostic to the procedures of tracking their sources, behaving as if there was only one version?

—SA


谢尔盖



我很感激你的响应。我们的团队是GIT的新手,我们不知道如何设置拉动来获取存储库的子集。你能给我们一些帮助吗?存储库不是面向公众的。



谢谢



Tom
Sergey

I appreciate your response. Our team is new to GIT and we don't know how to set pulls to get a subset of the repository. Can you give us some help? The repository is not public facing.

Thanks

Tom


这篇关于如何为多个.NET解决方案设置单个GIT存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆