简体   繁体   English

在解决冲突时,我如何判断 git 变基的距离?

[英]How can I tell how far into a git rebase I am when resolving conflicts?

I am rebasing in git and am encountering many conflicts.我在 git 中变基,遇到了很多冲突。 I address each one and do git rebase --continue , only to be met with the next conflict.我解决每个问题并执行git rebase --continue ,只是遇到下一个冲突。 How can I see how close I am to successfully completing the rebase?我如何才能看到我离成功完成 rebase 有多近?

I'm not sure if you can get a measure of how far you have to go, but it lists how many commits into the rebase you are.我不确定您是否可以衡量到 go 的距离,但它列出了您在变基中的提交次数。 In the error output is a line that looks like在错误 output 是一条看起来像

Patch failed at 0003 <commit message>

0003 means you're three commits into the rebase. 0003 表示您向 rebase 提交了三个提交。

It looks like you can see a list of patches here:看起来您可以在此处看到补丁列表:

.git/rebase-apply/[0-9]*

If your question is about seeing how many conflicts are already resolved, I have I usually do a quick如果您的问题是关于查看已经解决了多少冲突,我通常会快速

$ git diff

while doing a rebase.在进行变基时。 Conflicting parts will not be staged yet (assuming you are using git mergetool ).冲突的部分将不会暂存(假设您使用的是git mergetool )。

Alternatively you could also directly grep for the conflict markers.或者,您也可以直接 grep 作为冲突标记。

If you want to know how many commits were already applied, just use如果您想知道已经应用了多少次提交,只需使用

$ git log REBASE_BASE..

where REBASE_BASE is the commit you are rebasing onto.其中REBASE_BASE是您要基于的提交。

The text file.git/sequencer/todo will show you the next commits to be rebased or cherry-picked.文本 file.git/sequencer/todo 将向您显示下一个要重新定位或挑选的提交。

Also, in Windows, the Git Bash shell has the rebase progress status in the prompt in the following format:此外,在 Windows 中,Git Bash Z2591C98B70119FE624898B1E424B5 rebase 格式中的进度提示 9
(branch-name|REBASE 1/10)

From Powershell I can get to Git Bash with this command:从 Powershell 我可以使用以下命令到达 Git Bash:
sh --login

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在不解决其他提交冲突的情况下在 git 中变基,或者压缩我的所有提交,同时不影响其他人的提交? - How can I rebase in git without resolving other commit conflicts, or squash all of my commits while leaving others' commits untouched? 如何强制 git 变基并覆盖合并冲突 - How can I force a git rebase and override merge conflicts 在变基期间,如何让 Git 始终使用“他们的/我们的”来解决特定文件中的冲突? - How do I make Git always use "theirs/ours" for resolving conflicts in a particular file, during rebase? git:如何轻松判断我是否处于 rebase 中 - git: how can I easily tell if I'm in the middle of a rebase 当我没有做出任何改变时,如何在git交互式rebase中发生冲突? - How can there be conflicts in a git interactive rebase when I haven't made any changes? 解决重设冲突后如何在不使用强制推送的情况下将分支推送到远程站点? - How can I push a branch to remote after resolving rebase conflicts without using force push? 使用git rebase,我是否应该假装在解决冲突时未发生某些事情? - With git rebase, should I pretend that certain things didn't happen when resolving conflicts? 解决冲突后,如何才能完成git rebase - How can I get git rebase to complete after I resolve conflicts 如何在没有合并冲突的情况下将一长串 git 合并转换为单个 rebase? - How can I convert a long series of git merges into a single rebase without merge conflicts? Git pull with rebase导致过度冲突。 如何修复我们的工作流程? - Git pull with rebase causing excessive conflicts. How can I fix our workflow?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM