Consider the following scenario:
I have developed a small experimental project A in its own Git repo. It has now matured, and I\'d like A to be part of larger projec
If both repositories have same kind of files (like two Rails repositories for different projects), you can fetch data of the secondary repository to your current repository:
git fetch git://repository.url/repo.git master:branch_name
and then merge it to current repository:
git merge --allow-unrelated-histories branch_name
If your Git version is smaller than 2.9, remove --allow-unrelated-histories
.
After this, conflicts may occur. You can resolve them for example with git mergetool
. kdiff3
can be used solely with keyboard, so 5 conflict file takes when reading the code just few minutes.
Remember to finish the merge:
git commit