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