git推送拒绝非快进 [英] git push rejected non-fast-forward

查看:1436
本文介绍了git推送拒绝非快进的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在12个项目中有大约40,000行C ++代码。每个项目都有不同的git。
我有安装我的软件的shell脚本,放入NoSQL数据库,创建目录等。它还为每个项目创建一个源目录。 我使用克隆git clone



问题:



当我有变化,做一个本地的提交我不能推在我的主仓库
由于 git推拒绝-non -fast转发...
我是唯一可以访问这些文件的人。
所以这是不可能的推送是失败的,因为我的参考在远程存储库的后面。



PS
操作系统是Linux / Ubuntu



编辑1



local

  git log --graph --pretty = oneline -abbrev-commit 
* 5e540fd创始人初始提交版本2

主要

  git log  - 图--pretty = oneline -abbrev-commit 
* 74acd89创始人初始提交

编辑2



我只是使用CLI而不是eclipse完成所有操作。
所以手动我没有问题



主要

  git记录--oneline 
* 45f84ae ver 2
* 74acd89创始人初始提交

克隆

  git log --graph --oneline 
* 45f84ae ver 2
* 74acd89创始人初始提交

首先(编辑1)我正在使用日食为了使a)本地提交和b)推送



现在我使用终端,它正在作为一个魅力,但我不明白eclipse的问题



PS



我无法添加eclipse标签: - (

解决方案

我有一个坏习惯按提交修改按钮,因为我想要有以前的提交消息,我没有意识到我实际做了一个修改...
现在一切都像一个魅力一样。



感谢大家的帮助: - )


I have about 40,000 lines of C++ code in 12 projects. Each project has a different git. I have shell script which make the installation of my software, put the NoSQL database, create directories etc. It creates also a source directory for every project. I use the clone "git clone"

The problem:

When I have a change and make a local "commit" I cannot "push" in my main repository, Due to "git push rejected -non -fast forward"... I am the only one who has access to the files. So it is not possible "The push is failing because my refs are behind those of the remote repository."

PS The Operating system is Linux/Ubuntu

edit 1

local

git log --graph --pretty=oneline –abbrev-commit
* 5e540fd Founder initial commit  ver 2

main

git log --graph --pretty=oneline –abbrev-commit
* 74acd89 Founder initial commit

edit 2

I just done everything using CLI instead of the eclipse. So manually I have no problems

main

git log --graph -–oneline
* 45f84ae ver 2
* 74acd89 Founder initial commit

clone

git log --graph --oneline
* 45f84ae ver 2
* 74acd89 Founder initial commit

In the first place (edit 1) I was using the eclipse in order to make a) the local commit and b) the push

Now I was use the terminal and it is working as a charm, but I don't understand yet the problem with eclipse

PS

I can not add the eclipse tag :-(

解决方案

I had the bad habit to press the "commit amend" button because i wanted to have the previous commit message. I didn't realize that I actual made a amend... Now Everything work as a charm.

Thank everybody for the help :-)

这篇关于git推送拒绝非快进的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆