I wanted to give Github a try, so I create an account. To train myself, I created a remote repository, cloned into a folder on my computer, and experimented how to push a file I modified to the remote repository. For this, everything is fine.
Now comes the trouble: to experiment further, I created another remote repository, to which I want to push some code from a local repository. The push operation seems to be fine, as the pictures here below show
As you can see, the branch in my remote repository is called "main", and the branch in my local repository is called "master". The problem is when I try to make the changes effective in the remote repository (i.e. when I try to merge "master" into "main" by clicking the "Compare & pull request" button, if I express myself correctly ?), Github tells me that
There isn’t anything to compare. main and master are entirely
different commit histories.
hence I cannot put the changes online. Can someone explain me how to solve that problem ?
N.B.: I use Git Bash to have a command line to execute the operations
question from:
https://stackoverflow.com/questions/66049120/how-to-merge-branches-with-entirely-different-commit-histories-in-github 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…