Dovydas Navickas
Dovydas Navickas

Reputation: 3591

.git folder that has only link to repository, but no files embedded

Short version of the question would be:

What do I put to .git folder for the developer to be able to pull the newest version from the server, but not have the older one files embedded into .git?

Reason why I need that:

I have my application's core and other solutions that use the core.

I want to use separate GIT repository for the core and separate repository for every solution that uses core.

For examples sake, let us call core application Simple and new project Super

What I have so far is this structure:

Simple
Super.Config
Super.Web

A few comments:

Simple
----Here are core files
Super.Config
----Here are configuration files
Super.Web
----Here is the web project that uses core

Everything works just fine and I have all core files in a separate repository and Super repository looks like this:

Super.Config
Super.Web

What I want to do is add the Simple folder to Super repository with .git folder in there wich has only core repository url and not the files. Just for the Super project developer to be able to pull the latest core version from repository.

Therefore the structure that I want would be like this:

Simple
----.git
Super.Config
Super.Web

And when developer gets this structure, he/she just pulls files in Simple directory and gets the newest version of the core.

Upvotes: 0

Views: 104

Answers (1)

Rob Schmuecker
Rob Schmuecker

Reputation: 8954

If I understand what you want, I think you are talking about git submodules.

Have a look here as it's explained much better than I can!

http://git-scm.com/book/en/Git-Tools-Submodules

Upvotes: 1

Related Questions