h1990
h1990

Reputation: 165

Git Pull changes into a mono-repo from another repository

I have a single git repository containing multiple projects. I have pulled these projects from different git repos using the method described here:

https://medium.com/@ayushya/move-directory-from-one-repository-to-another-preserving-git-history-d210fa049d4b

Example Repo Structure:

ProjectOne

Now, the original git repo of ProjectA is constantly under development and I need to periodically pull in latest changes to my ProjectOne repo. I want to keep the commit history of ProjectA when pulling in changes. Does anyone here has any idea how to do it ?

Upvotes: 1

Views: 859

Answers (1)

VonC
VonC

Reputation: 1327184

Another approach would be to add ProjectA as a submodule of ProjectOne

cd ProjecTOne
git submodule add ProjectA /url/of/ProjectA

That way, a simple git submodule update --remote would be enough to update its content with the latest of ProjectA, and preserving its history.

Upvotes: 1

Related Questions