If you want to merge branch branchX from projectA into projectB:
cd path/to/projectA
git checkout branchXcd path/to/projectB
git remote add projectA /path/to/projectA
git fetch projectA --tags
git merge --allow-unrelated-histories projectA/branchX
git remote remove projectAThanks to this answer!