Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7845171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T17:08:25+00:00 2026-06-02T17:08:25+00:00

So I have two git repos. The first is our framework (think db abstraction,

  • 0

So I have two git repos. The first is our framework (think db abstraction, functions) and then another git repo for our new project.

I want to include the framework git repo into the project git, and according to GitHub Help, this should work:

 cd /project
 git remote add framework git://github.com/username/Framework.git
 git fetch framework
 git merge framework/master

The problem is, when I do the merge, it brings everything all files from framework and simply dumps them into the root of project. Instead, how can we have framework files merged into a child directory like /project/framework/?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T17:08:27+00:00Added an answer on June 2, 2026 at 5:08 pm

    You may want to look into Git’s submodule support. A submodule lets you embed one git repository inside another git repository. There are alternative solutions to this sort of thing, but I haven’t used them myself.

    An example might look like this:

    $ git clone git://github.com/username/project.git
    $ cd project
    $ git submodule add git://github.com/username/framework.git framework
    $ git commit -m "added framework submodule"
    

    If you are cloning a repository with submodules, you need to use the --recursive option:

    $ git clone --recursive git://<repository-with-submodules>.git
    

    Or alternatively, you can clone regularly and then run:

    $ git submodule init
    $ git submodule update
    

    Read the linked document (and git submodule --help) for more information.

    If changes are made to the submodule, you bring them in like this:

    # first update the submodule just like any other git repository
    $ cd project/framework
    $ git pull
    
    # now you have to record the new commit in the parent repository
    $ cd ..
    $ git commit -m "updated framework submodule"
    

    The last step is necessary because git keeps a record of the specific commit associated with a given submodule (so that when anyone clones the parent they’ll get that version of the submodule, rather than its most up-to-date revision, which could have undergone breaking changes that would prevent it to work as intended with the parent repository). So if you update the submodule, you need to record the new commit in the parent.

    If you make changes within the framework submodule, you would again just git push them like you would with any other repository. You would then have to commit the new revision in the parent module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got two git project repos that have two or three files in common.
We have two Git repos on a remote git server in this format: /git/repo1
I have a few Git Repos on GitHub like this: framework website #1 website
Possible Duplicate: Restore a deleted file in a Git repo I have two branches
I have two sub-directories each with a repo, thus : PPP/ |--ABC/ | |--.git/
Because of the way that our git repos are setup I have some static
In my 'project/repo' I have two MS Visual Studio projects, one for the main
I have a git repo with two divergent branches, production and v2. I'm working
I have two git repositories: report.git (Master on remote location) cloned.git (Local) I lost
I have two git branches, A and B, and commits numbered 1 thru 8.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.