初学者github会遇到的错误
来源:互联网 发布:网络时间参数计算例题 编辑:程序博客网 时间:2024/05/24 01:04
刚创建的github版本库,在push代码时出错:
$ git push -u origin master
To git@github.com:******/Demo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:******/Demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
网上搜索了下,是因为远程repository和我本地的repository冲突导致的,而我在创建版本库后,在github的版本库页面点击了创建README.md文件的按钮创建了说明文档,但是却没有pull到本地。这样就产生了版本冲突的问题。
有如下几种解决方法:
1.使用强制push的方法:
$ git push -u origin master -f
这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候。
2.push前先将远程repository修改pull下来
$ git pull origin master
$ git push -u origin master
3.若不想merge远程和本地修改,可以先创建新的分支:
$ git branch [name]
然后push
$ git push -u origin [name]
$ git push -u origin master
To git@github.com:******/Demo.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:******/Demo.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
网上搜索了下,是因为远程repository和我本地的repository冲突导致的,而我在创建版本库后,在github的版本库页面点击了创建README.md文件的按钮创建了说明文档,但是却没有pull到本地。这样就产生了版本冲突的问题。
有如下几种解决方法:
1.使用强制push的方法:
$ git push -u origin master -f
这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候。
2.push前先将远程repository修改pull下来
$ git pull origin master
$ git push -u origin master
3.若不想merge远程和本地修改,可以先创建新的分支:
$ git branch [name]
然后push
$ git push -u origin [name]
0 0
- 初学者github会遇到的错误
- 初学者指针会遇到的问题。。
- C++初学者容易遇到的几个错误
- android初学者遇到错误的解决方式
- Github新手可能会遇到的错误
- ComBoBox遇到的错误(初学者的错误)
- Git绑定GitHub时遇到的错误及解决方法
- VC++经常会遇到的链接错误LNK2001
- jbpm 中一个 开始就会遇到的错误
- HTMLDocument2 write c#会遇到的错误 IHTMLDocument2
- ios开发总会遇到的N大错误总结
- 学习snmp的体会(推荐一看,涵盖了初学者会犯的大部分错误)
- 初学者的小错误
- 初学者的错误
- 会遇到的问题
- MAVEN初学者遇到的问题
- GitHub的使用流程、初学者的使用方法
- 初学者上传文件到github的方法
- 营业外收入预算
- DP+树状数组优化-sort it-neu2016第一次月赛
- pcie干货系列之-TLP’s size/TLP fail/4K boundary/requs
- 文件读写和输入输出重定向
- ReactiveCocoa简介6,添加附加操作(Adding side-effects)
- 初学者github会遇到的错误
- Android Animations动画使用详解
- spark_2:spark的基础
- linux下安装googletest
- android 机器耗电
- 异常2
- swift 实现随机验证码,不区分大小写进行验证
- 【炼数成金-机器学习笔记】
- hdu 1258和ZJU 1711 Sum It Up(dfs经典索搜)