Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It probably doesn't answer your answer directly, but I think that this particular situation can be ruled with such feature of Git as <a href="http://git-scm.com/book/en/Git-Tools-Submodules" rel="nofollow"><strong>submodules</strong></a>.</p> <p>In this case you need to have two different repositories hosted somewhere, anyway. But with help of submodules you can tell Git that files of one repo should be located <strong>inside the directory tree</strong> of another one. Without causing the mess you described!</p> <p>For example, assuming that you have your projects hosted as <code>github.com/user/Client</code> and <code>github.com/user/Server</code> repos. Go to the folder of <code>Client</code> repository and do the following:</p> <pre><code>git submodule add git@github.com:user/Server.git src/server </code></pre> <p>This will clone the repo with given address into the folder you specified (<code>src/server</code> in this example).</p> <p>After that you have to commit changes. Although a lot of files were added, there will <strong>not</strong> be lots of changes in commit diff: there will be only a short record in special file saying that such repository now is a submodule. That is, files of <code>Server</code> not actually stored in <code>Client</code> repo, only the reference to them is stored. This is the power of git submodules.</p> <p>Note that after that, when you clone your <code>Client</code> repo somewhere else, its submodule will not be fetched by default. You have to use <code>git submodule update --init</code> to initialize submodules.</p> <p>Also note that the reference to <code>Server</code> submodule points to a specific revision of it. After you made some changes to <code>Server</code> repo you may want to go to <code>Client</code> repo, navigate to directory of submodule (<code>src/server</code> in this example) and do a simple <code>git pull</code> and commit changes in <code>Client</code> repo. Again, there will be no giant diff, only the new <strong>reference</strong> to submodule will be commited.</p> <p>As an example of the repo with submodules you can check out my repo for Vim settings directory: it has many plugins inside its <a href="https://github.com/NIA/dotvim/tree/master/bundle" rel="nofollow">bundle</a> folder and all of them are git submodules. GitHub shows them pretty well and allows easy one-click navigation to submodule repo if it is GitHub-hosted.</p> <p><em>P.S. If this all has nothing in common with what you want, and you simply want a folder <code>Server</code> to be added to repo <code>Client</code>, you can just copy <code>Server</code> to client <strong>and</strong> delete all traces of Git from <code>Server</code> directory (if there were some) by deleting <code>.git</code> inside it. Now you simply have one repo, commit all this lots of changes and go on. The drawback of this is complete loss of history of <code>Server</code> repo — it is not a big pain at the initial phase of project.</em></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload