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 7543465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:26:07+00:00 2026-05-30T08:26:07+00:00

Let say I’m owner of two remote projects: MainProject and AppsProject . In local

  • 0

Let say I’m owner of two remote projects: MainProject and AppsProject.

In local repository I want to have AppsProject in MainProject‘s subdirectory (apps/).

I’ve tried to use subtree merge strategy (ref.: Pro Git Book)
In MainProject‘s directory. I’ve done that:

$ git remote add apps-remote git@bitbucket.com:me/apps.git
$ git checkout -b apps-branch apps-remote/master
$ git checkout master
$ git read-tree --prefix=apps/ -u apps-branch
$ git checkout apps-branch
$ git pull

Actually what I want now is to be able commit local apps/ changes to AppsProject remote repository and anything what is not in apps/ to MainProject remote repository.

How to do that?

  • 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-05-30T08:26:08+00:00Added an answer on May 30, 2026 at 8:26 am

    To create a submodule:

    $ cd MainProject
    $ git submodule add git@bitbucket.com:me/apps.git apps
    $ git commit -a -m "added a submodule"
    $ git push
    

    Now to clone brand new:

    $ git clone --recursive git@bitbucket.com:me/MainProject.git
    

    Or if you had it cloned somewhere already but before you added the submodule:

    $ git submodule update --init 
    #Or without the --init to update the submodule
    

    Keep in mind that when you make changes to the submodule, you first want to commit the changes in the submodule, and then commit the changes in the main repo so that it picks it up. The submodule is always frozen at the last commit in the main repo.

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

Sidebar

Related Questions

let say i have a page , and i want to allow 3rd party
Let say I have two tables with a many-to-many relationship (i.e. there is a
Let say we have two arrays: DateTime[] wDates = new DateTime[20000]; double[] wValues =
Let say that i have id of another Xlib window and i want to
Let say I have a URL: http://java.sun.com/j2se/1.5/pdf I want to get a list of
Let say I have two UIViews: View1: - bounds: 0, 0, 20, 20 -
Let say i have 10 div's on a page , so what i want
Let say I have the following data in R. training = factor(c(1,1,3,2,1,3,2,34,67,34)) test =
Let say, that i have defined the same function for windows and mac, with
Let say I have abstract class called: Tenant and Customer. The tenant in this

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.