git 一直无法push的解决办法
来源:互联网 发布:空白网名软件 编辑:程序博客网 时间:2024/05/16 08:32
情况是这样的,我在修改完本地的代码之后 执行 add commit 这个时候应该可以push,然后我push了一下,然后命令行告诉我并没有修改任何内容,然后我刷新我的github的仓库也没有反应,的确push 失败了,然后我就再次重复上面的步骤 一次,发现还是不行,但是步骤并没有错,而且内容的确修改了,然后我git status了一下 这是显示的状态:
$ git statusHEAD detached from b735284nothing to commit, working directory clean然后我看了一下远程库中的版本的确是 b735284 ,然后我通过checkout修改了一下head还是不行,还是有这个问题,最后我在googlg上看到了一个外国大牛的解决办法,其实是我的分支出了问题,一试就成功了: 原文链接
$ git commit rear-release-notes.txt# HEAD detached from rear-1.16
I had now commits in a branch named:
$ git branch* (detached from rear-1.16) master
Ok, so I went back to the master branch:
$ git checkout masterWarning: you are leaving 2 commits behind, not connected toany of your branches: e9abc7a push release notes 1.16 (again) 2f5d3fd adding the release notes for 1.16 to doc/If you want to keep them by creating a new branch, this may be a good timeto do so with: git branch new_branch_name e9abc7aSwitched to branch 'master'
Then I executed the following steps with a temporary branch temp
to get the missing commits back into the master branch.
$ git branch temp e9abc7a$ git checkout tempSwitched to branch 'temp'$ git branch master* temp$ git log --graph --decorate --pretty=oneline --abbrev-commit master origin/master temp* e9abc7a (HEAD, temp) push release notes 1.16 (again)* 2f5d3fd adding the release notes for 1.16 to doc/* 4581e52 (tag: rear-1.16, origin/master, origin/HEAD, master) prepare rear for new release 1.16* de337d4 Merge pull request #403 from ypid/df-encfs-fix$ git diff master tempdiff --git a/doc/rear-release-notes.txt b/doc/rear-release-notes.txt....$ git diff origin/master tempdiff --git a/doc/rear-release-notes.txt b/doc/rear-release-notes.txt....$ git branch -f master temp$ git checkout masterSwitched to branch 'master'Your branch is ahead of 'origin/master' by 2 commits. (use "git push" to publish your local commits)$ git push$ git branch -d tempDeleted branch temp (was e9abc7a).
0 0
- git 一直无法push的解决办法
- git push 失败的解决办法
- git remote git push出错的解决办法
- 解决 git 无法 push 的问题
- Git Push失败 解决办法
- git无法push
- [实训]解决eclipse中git push一直需要输入远程push地址的问题
- git push remote error解决办法
- 自建git服务器push时报证书错的解决办法
- vs2015 fftw 一直无法打开xxx.lib的解决办法
- git commit 两次导致无法push的问题解决
- 关于git的push
- git push 的总结
- git push的问题
- git push 的使用
- Git push的使用
- Git push的常见问题
- Git Push 错误 [remote rejected] master -> master (branch is currently checked out) & 无法查看push后的git中文件
- 消息传递之:IOS NSNotificationCenter,Android EventBus;
- 手机上实现图片旋转
- Monkey的常见问题和解决办法
- Bitmap.createBitmap函数有6个重载方法
- 【C语言连载五】--------指针
- git 一直无法push的解决办法
- [学习笔记]A星寻路算法实例
- STL源码剖析-绪论
- 数据库面对不同业务逻辑约束条件的选择
- oracle客户端连接linux服务器上的oracle
- 移动应用性能测试白皮书
- iOS 开发流程笔记
- WIN10 下搭建WAMP(独立安装httpd2.4.16 mysql7.4.7 php 5.6.12 phpMyAdmin 4.4.13版本)
- CSU 1555 splay模拟