Git rebase导致与不再存在的.idea文件发生冲突

问题描述 投票:2回答:2

我在自己的分支上,并且在5或6次提交之前,我遇到了这个问题

First, rewinding head to replay your work on top of it...
Applying: commit x
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: The following untracked working tree files would be overwritten by merge:
        .idea/.gitignore
        .idea/credit-policy-runs.iml
        .idea/dataSources.xml
        .idea/misc.xml
        .idea/modules.xml
        .idea/vcs.xml
Please move or remove them before you merge.
Aborting
error: Failed to merge in the changes.
Patch failed at 0001 commit x
hint: Use 'git am --show-current-patch' to see the failed patch

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".


[当我无法执行git rm和git rebase时-继续,前一段时间我遇到了类似的问题,但以为我已解决它,显然我只是将其推迟了。

更新:当我删除vim .idea / .gitignore时,有一个文件,但是当我运行git rm .idea / .gitignore时,我却致命了:pathspec'.idea / .gitignore'与文件不匹配

更新:当我尝试使用-Xtheirs运行变基时,出现这些错误

CONFLICT (modify/delete): Runs.avpr deleted in origin/develop and modified in HEAD~63. Version HEAD~63 of Runs.avpr left in tree.
CONFLICT (modify/delete): .idea/misc.xml deleted in origin/develop and modified in HEAD~63. Version HEAD~63 of .idea/misc.xml left in tree at .idea/misc.xml~HEAD~63.

Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
git github rebase
2个回答
0
投票

[据我所知,没有在您的分支上跟踪文件(很好...不应该跟踪IDE元数据文件)....但是在other分支上没有跟踪文件... 。这可能是不正确的。请查看为什么/何时在该分支中添加了文件并将其从分支中删除(有大量配方可以从分支的历史记录中删除文件),然后在尝试合并时不会发生这种情况。

How can I delete a file from a Git repository?


-1
投票
git stash
git pull origin master --rebase

如果发生冲突,请解决冲突并进行

git add .
git rebase --continue

重复直到收到邮件倒带...

git stash pop
© www.soinside.com 2019 - 2024. All rights reserved.