Git远端仓库被不同版本的本地仓库push,不能正常提交代码
来源:互联网 发布:关键词分分析软件 编辑:程序博客网 时间:2024/05/20 04:51
$ git pushUsername for 'https://github.com': Grand2015To https://github.com/Grand2015/Leakage-simulation.git ! [rejected] master -> master (fetch first)error: failed to push some refs to 'https://github.com/Grand2015/Leakage-simulation.git'hint: Updates were rejected because the remote contains work that you dohint: not have locally. This is usually caused by another repository pushinghint: to the same ref. You may want to first integrate the remote changeshint: (e.g., 'git pull ...') before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details.
关键部分简单翻译一下:
错误:无法推一些参考“https://github.com/Grand2015/Leakage-simulation.git”
提示:更新被拒绝,因为远程包含您没有本地的工作。
这通常是由另一个存储库推送到同一个引用引起的。
您可能希望首先集成远程更改(例如,“git pull ...”),然后再次推送。
有关详细信息,请参阅“git push --help”中的“关于快进的注意事项”。
原因很明了,git远端仓库被不同版本的本地仓库push了,解决这个问题先要对本地仓库与远端仓库进行合并,
执行指令:git pull origin master会出现对话框让你输入融合的理由
i 开始输入
esc:wq保存退出
$ git pull origin masterremote: Counting objects: 3, done.remote: Compressing objects: 100% (1/1), done.remote: Total 3 (delta 1), reused 3 (delta 1), pack-reused 0Unpacking objects: 100% (3/3), done.From https://github.com/Grand2015/Leakage-simulation * branch master -> FETCH_HEAD b31ecb7..ed39b19 master -> origin/masterMerge made by the 'recursive' strategy. README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
融合完成,接着提交数据
$ git pushUsername for 'https://github.com': Grand2015Counting objects: 20, done.Delta compression using up to 4 threads.Compressing objects: 100% (20/20), done.Writing objects: 100% (20/20), 63.56 KiB | 0 bytes/s, done.Total 20 (delta 14), reused 0 (delta 0)remote: Resolving deltas: 100% (14/14), completed with 5 local objects.To https://github.com/Grand2015/Leakage-simulation.git ed39b19..bd61e7b master -> master
成功提交代码
1 0
- Git远端仓库被不同版本的本地仓库push,不能正常提交代码
- Git 【初次提交代码到空的远端仓库】
- Git使用手册:git push 推送提交本地仓库代码文件到远程仓库
- git本地仓库push
- git 使用注意事:将本地仓库代码提交到远端(这里使用的是github)
- git 仓库远端与本地端代码管理
- git 提交本地代码到远程仓库
- 删除本地项目与远端git仓库的关联
- git本地与远端仓库关联
- Git把本地代码push到oschina git仓库
- git 本地push错误,导致远程仓库版本错误
- Git 回退即删除本地仓库commit版本以及删除远端仓库相应的版本(即github上的commit版本)
- 版本控制git 下载,安装,创建代码仓库,提交本地代码
- 【Git】git将本地代码提交到远程仓库
- GIT远端仓库备份
- Git远端仓库(二)
- Git push提交到远程仓库卡住的问题解决
- git学习--repo批量创建远端仓库----建立自己的android代码仓库
- web.xml初始化过程
- 学习的JS放大镜
- js中this的指向
- 在 Ubuntu 14.x 搭建 Nginx Uwsgi Django 环境之(三):连接 nginx 和 uwsgi
- 链表类面试题
- Git远端仓库被不同版本的本地仓库push,不能正常提交代码
- HDU 1020 Encoding
- 二分贪心d
- opencv3.2生成不依赖vs2015的dll
- 霍夫曼编码的实现(数组模拟)
- Android之Activity的四种启动模式
- cookie,sessionStorage,localStorage分别是什么,以及三者之间的区别
- AVL树的旋转LL RR LR RL
- ES6的let和const命令(一)