I've added a remote repository to the folder where I am working with :
git remote add origin https://github.com/<username>/<repo>.git
If I type:
git pull origin master
I get:
From https://github.com/<username>/<repo>
* branch master -> FETCH_HEAD
fatal: refusing to merge unrelated histories
I have also tried:
$ git pull origin master --allow-unrelated-histories
But I get:
From https://github.com/...
* branch master -> FETCH_HEAD
error: Your local changes to the following files would be overwritten by merge:
<files>
Please commit your changes or stash them before you merge.
Aborting
You need to either reset
or commit
your changes first:
git reset --hard
or:
git commit -m "saving changes..."
Then you can do:
git pull origin master --allow-unrelated-histories
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With