Merge code between two dfferent git repositories

狂风中的少年 提交于 2019-12-12 01:38:52

问题


I have readonly access to repo A and have my own repo B. Repo A contained multiple branches A1, A2 etc repo B has branches B1, B2 etc. Both repo A and repo B has remotes

Repo A branch A1 equal to repo B branch B1 folder F so how can I merge all changes from repo A branch A1 to repo B branch B1 folder F using git command by keeping all the history?

Currently I am just copying the files manually by overriding the content on B1 folder F which is not right I believe.

UPDATE what I've done so far:

1) on branch B directory i run a command git remote add A path/to/A

2) then git fetch A so I've got all stuff from repo A in my repo B

So the question now how can I merge branch A1 to branch B folder F there is a command git merge A/A1 but how can I specify that I want to merge branch A1 to branch B1 folder F in that command ?

来源:https://stackoverflow.com/questions/35590795/merge-code-between-two-dfferent-git-repositories

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!