Reputation: 12459
I cloned and forked a repository from here source: https://github.com/react-community/react-native-maps resulting in two different repositories.
Clone Repo:
https://github.com/Stophface/react-native-maps-0.20.1 (repo 1)
Fork Repo:
https://github.com/Stophface/react-native-maps (repo 2)
Now I want to merge the Clone Repo
(repo 1) into the Fork Repo
(repo 2), preserving history if possible. Is that even possible?
I followed the instructions here. When I try to merge the Clone repo
(repo 1) into the Forked Repo
(repo 2) I get the error
fatal: refusing to merge unrelated histories
Upvotes: 0
Views: 162
Reputation: 4878
You can just added the repo1 as a new remote and them merge it into your local repository:
Clone the fork https://github.com/Stophface/react-native-maps
git clone https://github.com/Stophface/react-native-maps && cd react-native-maps
Add a new remote to your local repository
git remote add repo1-origin https://github.com/Stophface/react-native-maps-0.20.1
Merge the content from remote repo1-origin
into your local fork (repo2)
git pull repo1-origin [branch-name]
OBS: Both of a rebase or a simple merge will preserve your git history, but if you want to preserve the commits chronology in your git log
, I recommend you to do rebase:
git pull --rebase repo1-origin [branch-name]
That way you will merge the two contents
Upvotes: 1