Weird Git Rebase Error

岁酱吖の 提交于 2019-12-13 01:23:50

问题


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!


回答1:


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



来源:https://stackoverflow.com/questions/9167542/weird-git-rebase-error

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!