Fork me on GitHub

Git: Push rejected 的解决方案

Push rejected: Push to origin/master was rejected

首先,git init (在工程文件夹下)

git remote add [-t <branch>] [-m <master>] [-f] [--[no-]tags] [--mirror=<fetch|push>] <name> <url>

即:(针对问题 Your local changes to the following files would be overwritten by merge)

git remote add  <name> <url>  

用如下命令检验:

git remote -v  

然后:

git pull origin master --allow-unrelated-histories
git pull origin master  

接下来即可push和pull

posted @ 2018-08-17 17:21  stardsd  阅读(20496)  评论(1编辑  收藏  举报