Cannot push to GitHub - keeps saying need merge

后端 未结 30 2740
天命终不由人
天命终不由人 2020-11-22 00:09

I\'m new to GitHub. Today I met some issue when I was trying to push my code to GitHub.

Pushing to git@github.com:519ebayproject/519ebayproject.git
To git@gi         


        
30条回答
  •  Happy的楠姐
    2020-11-22 00:46

    First and simple solution:

    • Try this command git push -f origin master.
    • This command will forcefully overwrite remote repository (GitHub)

    Recommended Solution 1 :

    • Run these commands:
    git pull --allow-unrelated-histories  //this might give you error but nothing to worry, next cmd will fix it
    git add *
    git commit -m "commit message"
    git push
    

    If this doesn't work then follow along

提交回复
热议问题