git&快进更新 [英] git & fast-forward updates

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

问题描述

我对git和github还是个新手......好吧,我在github上分了一个插件,并在之后做了一些改动。所有者添加了一些我的更改,但github未显示我的更改已合并。从那时起,其他一些用户已经分叉并更新了插件。



今天我下载了最新的分叉版本(尚未合并到主版本中)试图将它们保存到我的存储库。推送被拒绝,我得到了一个非快进的更新被拒绝。合并远程更改......然后我做了一些非常愚蠢的事情 - 我删除了我的github存储库并分支了最新的分支。



现在,如果我尝试推送I我重新初始化了我的git git init 并尝试从主控制器 git pull {name} master SO答案)我得到了一个致命的:...... git-pull不能在没有工作树的情况下使用。我也尝试了 SO答案并得到同样的错误。

有什么可以解决这个问题并推送最新版本的吗?


$ b 编辑:哎呀我用 git pull 不是 git remote add ... code>

解决方案

拒绝与非快进意味着您的本地资源库不可用到目前为止,你必须在本地进行合并,然后才能再次推送。你必须先拉。


I'm still new to git and github... well, I forked a plugin on github and made a few changes a while back. The owner added some of my changes, but github didn't show that my changes were merged. Since that time, a few other users have forked and updated the plugin.

Today I downloaded the latest forked version (not yet merged into the master), made my changes and tried to save them to my repository. The push was rejected and I got a "non-fast-forward" updates are rejected. Merge the remote changes...". Well then I did something really stupid - I deleted my github repository and forked the latest branch.

Now if I try to push I get the same error. I've reinitialized my git git init and tried to pull from the master git pull {name} master (from this SO answer) and I get a "fatal: ... git-pull cannot be used without a working tree". I've also tried the commands from SO answer and get the same error.

Is there anything I can do to fix this and push the lastest version?

Edit: Oops I used git pull not git remote add...

解决方案

A reject with non fast forward means that your local repository is not up to date and that you will have to do a merge locally before you can push again. You have to pull first.

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

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