简体   繁体   中英

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

  • ProjectA
  • ProjectB
  • ProjectC

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM