奇怪的Git Rebase错误 [英] Weird Git Rebase Error

查看:561
本文介绍了奇怪的Git Rebase错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个rebase的问题,这里是我的设置:



我有一个远程git仓库和一个本地主分支,它应该在远程仓库,我总是从我的本地主分支分支。



要更新我的本地主数据库,我执行 git fetch; git rebase< remote>



一旦完成,我切换到我的开发分支 git checkout my_dev_branch ,然后运行 git rebase master 。这一直很好。



但是我刚刚执行了 git fetch; git rebase< remote> ;; 得到了

 无法重新分配:您有未分配的更改。 
请提交或储存它们。

当我运行 git status 时,回。然后我运行了 git stash 并试图重新绑定,但得到了同样的错误。我甚至试过 git reset --hard< remote> 但我在重新绑定时仍然遇到同样的错误。



有谁知道whay我收到这个错误以及如何解决它?

预先感谢! / p>

解决方案

查看这个答案,看看它是否可以解决问题。
https://stackoverflow.com/a/5255700/275583



建议尝试设置配置选项并查看它是否解决您的问题:

  git config --global core.trustctime false 

与您的工作流程相关的其他问题:

您是唯一在此远程存储库上工作的人吗?
如果你是这样,为什么你需要从远程执行一个抓取或拉取操作,因为没有其他人做出改变?



如果你总是在工作在分支机构上,那么只要你想更新它,你就应该能够将更改提交给你的主分支。

所以我不太清楚你的工作流程,你可以希望澄清一点,无论是在这里还是在不同的问题,以获得更好的工作方式。



祝你好运


I am having problems with a rebase, here is my setup:

I have a remote git repo, and a local master branch which should mirror on the remote repo, I always branch off of my local master branch.

To update my local master I perform git fetch; git rebase <remote>

Once this has been completed I switch to my development branch git checkout my_dev_branch, and then run git rebase master. This has been working great.

But I have just performed git fetch; git rebase <remote>; and got

Cannot rebase: You have unstaged changes.
Please commit or stash them.

When I run git status I get nothing returned. I then ran git stash and tried to rebase again, but got the same error. I even tried git reset --hard <remote> but I still get the same error when trying to rebase.

Does anyone know whay I am getting this error and how to fix it?

Thanks in advance!

解决方案

Have a look at this answer and see if it resolves the issue. https://stackoverflow.com/a/5255700/275583

As suggested try setting the config option and see if it resolves your issue:

git config --global core.trustctime false

Other questions related to your workflow:

Are you the only person working on this remote repository? If you are, why do you need to ever do a fetch or pull from remote since no one else has made changes?

And if you are always working on branches, then you should be able to just pull changes to your master branch whenever you want to update it.

So I am not too sure about your workflow, you may want to clarify a bit, either here or in a different question, to get a better way of working.

Good luck

这篇关于奇怪的Git Rebase错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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