git之Pushing to the remote branch is not fast-forward错误解决
来源:互联网 发布:java 暂停1秒 编辑:程序博客网 时间:2024/05/16 11:32
今天推送代码的时候报错了这个Pushing to the remote branch is not fast-forward,so the push has to be forced.The commits in the remote branch will be lost 错误,然后就出现这个效果,下面是图片。
问题(Non-fast-forward)的出现原因在于:git仓库中已经有一部分代码,所以它不允许你直接把你的代码覆盖上去。于是你有2个选择方式:
1,强推,即利用强覆盖方式用你本地的代码替代git仓库内的内容
git push -f
2,先把git的东西fetch到你本地然后merge后再push
$ git fetch
$ git merge
这2句代表命令
$ git pull
然后我就用gitsmart pull 了下
这等于告诉git2件事:
1,当你处于master branch, 默认的remote就是origin。
2,当你在master branch上使用git pull时,没有指定remote和branch,那么git就会采用默认的remote(也就是origin)来merge在master branch上所有的改变先pull 下来 然后再commit 最后push就成功了
你再看下截图
0 0
- git之Pushing to the remote branch is not fast-forward错误解决
- (git问题)解决The current branch is not configured for pull No value for key remote.origin
- git错误non-fast-forward的解决
- git push错误 remote: error: refusing to update checked out branch: refs/heads/master 解决方式
- Git- [!remote rejected]:refusing to delete the current branch
- How to delete the remote branch in git
- Eclipse git 错误:The current branch is not configured for pull
- Eclipse使用GIT进行pull时候的错误 : The current branch is not configured for pull
- git 解决The current branch is not configured for pull No value for key branch.master.merge found in co
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- Git错误non-fast-forward后的冲突解决
- SSH 框架搭建与开发
- POJ 1007 DNA Sorting
- python脚本使用SFTP下载远程计算机文件
- 随机数的使用
- C++从Txt中读取内容
- git之Pushing to the remote branch is not fast-forward错误解决
- Android 工具类 —— 判断网络连接状态、GPS是否打开、基站信息和手机IMSI码
- ios9设置bitcode AMR编译
- 计算机视觉中的曲率尺度空间技术
- 屏幕旋转方向
- 自定义Activity堆栈管理类
- Android 通过Service单独进程模仿离线推送 Server Push
- 将字符串三位一个逗号显示
- libusb-win32 连续调用 usb_find_busses