终端上传项目

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

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,449评论 0 10
  • origin websiteComparing WorkflowsCentralized Workflow Fea...
    伍帆阅读 524评论 0 0
  • 2016.12.4 虽然14年开发第一个项目时就已经接触了git,当时xcode已经开始支持git,在github...
    張小明阅读 416评论 1 0
  • github为开发者提供了很好的开源库平台,而我们在写博客的时候,有时候还要给读者小伙伴们提供一些demo或者框架...
    哈哈大p孩阅读 631评论 0 3
  • 看了《人物》公众号的专访,是采访湖南那位记录大学四年餐食的女生,文中说她有写日记的习惯,小到今天花了几块钱都会记录...
    掉刺仙人掌阅读 642评论 0 0