Git (master|REBASE 1/1) 是什么意思?我该如何摆脱它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18292578/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does Git (master|REBASE 1/1) mean? How do I get rid of it?
提问by Captain Stack
I'm kind of a gitbeginner and I was attempting to roll back to a previous commit. But I accidentally just rolled back the commit (I was using the Windows GUI). Anyway, after some weird pushing, merging, and other confusing stuff I didn't quite understand, I finally got my files the way I wanted them. The only weird thing is in the shell now it says:
我是一个git初学者,我试图回滚到以前的提交。但我不小心回滚了提交(我使用的是 Windows GUI)。无论如何,经过一些奇怪的推送、合并和其他我不太明白的令人困惑的事情之后,我终于按照我想要的方式得到了我的文件。现在唯一奇怪的是在外壳中它说:
(master|REBASE 1/1)
(大师|REBASE 1/1)
It used to just say master
, so what happened? What does this mean? And how do I get it back to how it was?
它曾经只是说master
,那发生了什么?这是什么意思?我怎样才能让它恢复原状?
回答by dkrikun
You are stuck in the middle of a rebase.
你被困在变基的中间。
If you have merged/solved conflicts for all the paths:
use git add .
to commit resolved items.
use git rebase --continue
to complete the process.
如果您已合并/解决了所有路径的冲突:
用于git add .
提交已解决的项目。
用于git rebase --continue
完成该过程。
Or use git rebase --abort
to exit the rebase process without any risk.
或用于git rebase --abort
退出 rebase 过程而没有任何风险。
回答by ericj
If git rebase --continue | --skip | --abort
still do not work:
如果git rebase --continue | --skip | --abort
还是不行:
You might try to discard your local commitone by one, then use git status
to make sure your local commit are up-to-date with remote branch.
您可能会尝试一一丢弃您的本地提交,然后使用它git status
来确保您的本地提交与远程分支保持同步。
git reset --hard HEAD~1
NOTE: git reset --hard
will discard your work, use it only if you know what you are doing!!
注意:git reset --hard
将丢弃您的工作,仅当您知道自己在做什么时才使用它!!
回答by sohal
Abort the rebase and take pull again.
中止变基并再次拉动。
git rebase --continue
git rebase --abort
git rebase --continue
git rebase --abort
This is worked for me.
这对我有用。
回答by Ram
Delete below folder which is within the working repo/git .git\rebase-merge
删除工作 repo/git .git\rebase-merge 中的文件夹
回答by Deepa
If there are no unsaved changes in your directory , run the following commands
如果您的目录中没有未保存的更改,请运行以下命令
This will reset your current branch to remote repo
git reset --hard origin/branch e.g. git reset --hard origin/master
Delete the folder - repo\git.git\rebase-apply
这会将您当前的分支重置为远程仓库
git reset --hard origin/branch 例如 git reset --hard origin/master
删除文件夹 - repo\git.git\rebase-apply