gpt4 book ai didi

git - 无法解决 rebase 冲突

转载 作者:IT王子 更新时间:2023-10-29 00:34:27 24 4
gpt4 key购买 nike

foo:/opt/bar$ git status
# On branch develop
nothing to commit (working directory clean)

foo:/opt/bar$ git pull --rebase origin develop
From ssh://xxx/yyy
* branch develop -> FETCH_HEAD
First, rewinding head to replay your work on top of it...
Applying: Subscription logging added.
Using index info to reconstruct a base tree...
<stdin>:120: trailing whitespace.
* @return integer
<stdin>:143: trailing whitespace.
* @return integer
<stdin>:166: trailing whitespace.
* @return integer
<stdin>:189: trailing whitespace.
* @return integer
<stdin>:212: trailing whitespace.
* @return integer
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging app/config/config.yml
CONFLICT (content): Merge conflict in app/config/config.yml
Failed to merge in the changes.
Patch failed at 0001 Subscription logging added.

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

foo:/opt/bar$ git status
# Not currently on any branch.
# Unmerged paths:
# (use "git reset HEAD <file>..." to unstage)
# (use "git add/rm <file>..." as appropriate to mark resolution)
#
# both modified: app/config/config.yml
#
no changes added to commit (use "git add" and/or "git commit -a")

foo:/opt/bar$ git add -A

foo:/opt/bar$ git status
# Not currently on any branch.
nothing to commit (working directory clean)

foo:/opt/bar$ git rebase --continue
Applying: Subscription logging added.
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.

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

foo:/opt/bar$ git add -A

foo:/opt/bar$ git status
# Not currently on any branch.
nothing to commit (working directory clean)

foo:/opt/bar$ git rebase --continue
Applying: Subscription logging added.
No changes - did you forget to use 'git add'?
If there is nothing left to stage, chances are that something else
already introduced the same changes; you might want to skip this patch.

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

foo:/opt/bar$

最佳答案

您走在正确的道路上。您只需要使用跳过您遇到问题的提交:

git rebase --skip

您已经解决了冲突,但是与之前的提交相比没有任何变化。在这种情况下,您不能只是 git rebase --continue,因为您是在告诉 Git 创建一个空提交,这是不允许的。

如果您与任何其他提交有冲突,您仍应使用 git rebase --continue

当您根本不想在新生成的历史记录中包含某些提交时,--skip 选项也很有用。

关于git - 无法解决 rebase 冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22814602/

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