Git push本地代码到github出错
2015-07-29 23:00
330 查看
Git push本地代码到github出错
错误:
$ git push -u origin master To git@github.com:*/*.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:*/*.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.
原因:
远程repository和本地repository冲突导致. 创建版本库时创建了README.md文件,但是却没有pull到本,这样就产生了版本冲突的问题.
解决:
强制push: (这样会使远程修改丢失,一般是不可取的,尤其是多人协作开发的时候.)$ git push -u origin master -f
push前先将远程repository修改pull下来
$ git pull origin master $ git push -u origin master
相关文章推荐
- RPC failed; result=22, HTTP code = 411
- 查看github pages文档的方式
- 使用BAE的基于Web.py的简单博客程序
- git更新已經刪除的文件
- 提取Git每次提交后Commit的文件
- GIT迁移服务器
- 分布式版本管理git入门指南使用资料汇总及文章推荐
- Patrol 7 架构下?的处理方法
- 一步一步跟我学易语言之第二个易程序菜单设计
- 中病毒后常用的解决方法病毒终极解决方案
- QQ尾巴 InfoMs.Ime 解决方案
- IE对CSS样式表的限制分析与解决方案
- 开源MySQL高效数据仓库解决方案:Infobright详细介绍
- 两分钟学会如何在github托管代码
- FCK编辑器(FCKEditor)添加新按钮和功能的修改方法
- ecshop后台编辑器替换成ueditor编辑器
- 10个基于jQuery或JavaScript的WYSIWYG 编辑器整理
- 惊现支撑1亿pv/天的超级数据库解决方案
- 关于bluehost空间上wordpress后台变为英文的解决方案