开发者

How do I best organise multiple projects in GIT?

开发者 https://www.devze.com 2023-02-05 05:12 出处:网络
I\'m elaluating whether GIT is possible to organise our projects. We are working under Windows with Visual Studio 2010 on a local network.

I'm elaluating whether GIT is possible to organise our projects. We are working under Windows with Visual Studio 2010 on a local network.

Our project organisation is as follows:

We have a shared code base (call it SHARE) where all developers are allowed to extend, modify and do bug fixes. All developers have multiple private projects which depend on thes shared code base. So the structure is:

root
   |
   +-- SHARE
   +-- Project 1 Dev 1
   +-- Project 2 Dev 1
   +-- Project 1 Dev 2

What I think of is one origin Repository on a network drive with clones on every developer PC and 1 private Repository for each project on the developer 开发者_如何学JAVAPCs (maybe some backup on network as well). Good would be some kind of link, so that when a developer checks out his project he will get the correct shared source as well. Is this possible with GIT and how?

Or can you recommend a better way?


Good would be some kind of link, so that when a developer checks out his project he will get the correct shared source as well. Is this possible with GIT and how?

Submodules is probably what you're after -- they let you store a "pointer" to some other repo inside a main one (the "superproject") with metadata about the exact "state" of the subproject so everyone is working against a consistent shared subproject.

The submodule itself can be worked on and improved just like any other repository, and the "state" pointer can be updated to the newly agreed upon version whenever is appropriate.

So your superproject would contain one submodule: "shared", and when devs clone your main repo, they run git submodule init && git submodule update to automatically get their submodules set up as necessary.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号