Xcode怎么删除原本git,在重新设置新的git地址
关闭Xcode
打开终端
1.首先先进入到项目目录 cd ****
2.删除原本的git仓库 rm -fr .git
git init
git remote add origin http://******************
git add .
git commit -m “Initial commit”
git push -u origin master
3.然后用Xcode,push
报错
MacBook-Pro:数据库课程设计 Pett$ git push origin master
To github.com:peTzxz/Property-management-system
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'git@github.com:peTzxz/Property-management-system'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
---------------------
出现这个问题是因为github中的README.md文件不在本地代码目录中,可以通过如下命令进行代码合并
解决
git pull --rebase origin master
git push origin master