I have a CMS theme installed on my machine. I\'m tracking changes to it via git and decided to back it up on GitHub so I could share those changes.
The theme as prov
I don't think we have same case here, but still someone else may find it helpful.
When similar error occurred to me, it was going to be the first merge and first commit. There was nothing in on-line repository. Therefore, there was no code on git-hub, to compare with.
I simply deleted the empty repository and created new one with same name. And then there was no error.
If you know from which commit issue started, you can reset your branch to that commit and then merge them.
This happened with me yesterday cause I downloaded the code from original repo and try to pushed it on my forked repo, spend so much time on searching for solving "Unable to push error" and pushed it forcefully.
Solution:
Simply Refork the repo by deleting previous one and clone the repo from forked repo to the new folder.
Replace the file with old one in new folder and push it to repo and do a new pull request.
I had a similar situation, where my master branch and the develop branch I was trying to merge had different commit histories. None of the above solutions worked for me. What did the trick was:
Starting from master:
git branch new_branch
git checkout new_branch
git merge develop --allow-unrelated-histories
Now in the new_branch, there are all the things from develop and I can easily merge into master, or create a pull request, as they now share the same commit hisotry.
Top guy is probably right that you downloaded instead of cloning the repo at start. Here is a easy solution without getting too technical.
Make sure that all your edits are copied over by looking at your older github branch.
I solved that problem. In my case when i did “git clone” in one directory of my choice without do “git init” inside of that repository. Then I moved in to the cloned repository, where already have a “.git” (is a git repository i.e. do not need a “git init”) and finally I started do my changes or anything.
It probably doesn’t solve the problem but shows you how to avoid it.
The command git clone should be a “cd” command imbued if no submodule exists.