gpt4 book ai didi

git rebase 由于空格错误而失败

转载 作者:IT王子 更新时间:2023-10-29 01:25:32 25 4
gpt4 key购买 nike

我正在尝试对一个分支进行 rebase ,但 git 正在 pop ,因为它正在尝试执行一些失败的 merge 操作。我如何让 git 停止它?

# git rebase -f --onto master~2 master~ master
First, rewinding head to replay your work on top of it...
Applying: r1002 - CS 1.0.23
Using index info to reconstruct a base tree...
M about.html
<stdin>:68: trailing whitespace.
<stdin>:115: trailing whitespace.
<stdin>:201: trailing whitespace.
<stdin>:2369: trailing whitespace.
<stdin>:2385: trailing whitespace.
warning: squelched 2305 whitespace errors
warning: 2310 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging about.html
CONFLICT (content): Merge conflict in about.html
Failed to merge in the changes.
Patch failed at 0001 r1002 - 1002
The copy of the patch that failed is found in:
/local/melder/tmp/test/.git/rebase-apply/patch

When you have resolved this problem, run "git rebase --continue".
If you prefer to skip this patch, run "git rebase --skip" instead.
To check out the original branch and stop rebasing, run "git rebase --abort".

如您所见,有 2000 多个空格错误,手工 merge 不容易。

编辑:暂时避开这个而不 merge 我做了:

# git add -A
# git rebase --continue

<罢工>

编辑:没关系,这是个愚蠢的想法。

最佳答案

我今天遇到了同样的问题:由于空格错误引起的冲突,rebase 失败。在对 whitespace 选项(git rebase --whitespace=fixgit rebase --whitespace=nowarn)进行不同设置的试验失败后,对我有用的解决方案是忽略递归 merge 策略中的尾随空白错误(git rebase --abort any running rebase first if needed):

git rebase -Xignore-space-at-eol <newbase>

根据空白错误的类型,选项 -Xignore-space-change-Xignore-all-space 可能更有用。我不知道选项 --ignore-whitespace 是否也有效。

关于git rebase 由于空格错误而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13463173/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com