[Github] git push "提示:更新被拒绝,因为您当前分支的最新提交落后于其对应的远程分支。"的解决办法

1144 查看

本地已存在项目,需要先获取远端更新并与本地合并,再git push
具体操作如下:

git remote add origin https://github.com/username/Hello-World.git  
$git fetch origin    //获取远程更新
$git merge origin/master //把更新的内容合并到本地分支

参考:Github学习