3

I set a new url to previously used origin in our server as

git remote set-url origin [new_url]

Now there's an error when I'm trying to pull

git pull origin dev
fatal: refusing to merge unrelated histories

I set the new url beacuse i don't want to create a new origin for doing stuff. How can I solve this?

Edit :-

When added the git pull origin dev --allow-unrelated-histories an error comes up again. and some untrack files are shown

error: The following untracked working tree files would be overwritten by merge:

I want to overwritten the files

Tharindu
  • 325
  • 6
  • 16
  • 2
    Duplicate of: https://stackoverflow.com/questions/38255655/trying-to-pull-files-from-my-github-repository-refusing-to-merge-unrelated-his/40959920 https://stackoverflow.com/questions/37937984/git-refusing-to-merge-unrelated-histories-on-rebase ? – Ripp_ Aug 20 '18 at 10:05
  • *"When added the git pull origin dev --allow-unrelated-histories an error comes up again. and some untrack files are shown `error: The following untracked working tree files would be overwritten by merge:` I want to overwritten the files"* - Just delete the listet files manually – Timothy Truckle Aug 20 '18 at 10:21
  • It may sound like a duplicate because the first error message is the same, but the scenario with the `git remote set-url` command is a little different – Jaap Jan 16 '20 at 12:48

0 Answers0