简体   繁体   中英

Take latest commits from multiple repos then merge into another single repo without creating a new repo

As per the requirement we have got mutliple repo containing many projects and have merged these into single repo which contains all the projects which exists in multiple repo. I have done merged these into single repo and it contains all the commits till the merged date. After the merge ,Single repo doesn't contain those new commits present in multiple repo.

My question is

1)How can we pick the latest commits from multiple repo

2)If it is possible to pick those commits how it could be merged to single repo

Have tried with cherry-picking but it creates the new commit id which differs from that of multiple repo commit id that should not happen in our case.

I would advice you to use submodules . But your "final" repo will be updated with the new commits on sub repos so I don't know if it's what you want to do.

I may have another solution :

  • make a new git repo git init
  • add remotes for each repo you want to add git remote add origin1 http://myurl.com
  • add all files for all remotes : git checkout origin1/master -- .

I'm not sure if it will work but I will definitely try out

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