Suppose you wanna merge repoA and repoB with no common history
- cd into repoA
- Add repoB as remote
git remote add repoB <repoB url>
- Fetch repoB's content
git fetch repoB
Alternatively 2 & 3 can be done together as
git remote add -f repoB <repoB url
#Add repoB as remote and fetch its contents
-
Merge
git merge --allow-unrelated-histories repoB
Remove merge conflicts (if any) then commit -
Optional: Remove remote to repoB
git remote remove repoB