There isn't anything to compare. Nothing to compare, branches are entirely different commit histories

后端 未结 18 804
北恋
北恋 2020-12-12 22:54

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

18条回答
  •  醉梦人生
    2020-12-12 23:07

    You can force update your master branch as follows:

    git checkout upstreambranch  
    git branch master upstreambranch -f    
    git checkout master  
    git push origin master -f
    

    For the ones who have problem to merge into main branch (Which is the new default one in Github) you can use the following:

    git checkout master  
    git branch main master -f    
    git checkout main  
    git push origin main -f
    

    The following command will force both branches to have the same history:

    git branch [Branch1] [Branch2] -f 
    

提交回复
热议问题