2015-08-26 37 views
0

我想重新绑定我的开发分支上的一个功能分支,但是我得到下面的错误。我不确定,但我认为这发生在我将文件从一个文件夹移动到另一个文件夹时。那些抱怨的文件没有在分支上做出任何改变,因此我不确定问题所在。这最初发生在git 2.2.2;我只是尝试升级到2.5.0,它仍然在发生。Git Rebase报告错误,但没有什么要修复

如果我忘记了rebase,并将我的功能分支合并到develop分支中,那么一切正常。 Git将功能分支与开发分支合并没有问题。

有没有人对我如何完成rebase有任何建议?我尝试使用git rebase --skip选项,但是这导致了一堆代码(据推测其他提交)被删除。

First, rewinding head to replay your work on top of it... 
Applying: Entries now populate the Schedule A table when a calendar day is clicked; other refactoring 
Applying: Introduce DailyLog 
Using index info to reconstruct a base tree... 
<stdin>:37: trailing whitespace. 
    @function_groups = current_user.organization.visible_function_groups 
<stdin>:82: trailing whitespace. 
    if @entry.save 
<stdin>:111: trailing whitespace. 
    # for a given day. 
<stdin>:136: trailing whitespace. 
    self.create(user: user, created_at: the_date_time, organization_id: user.organization.id, 
<stdin>:383: trailing whitespace. 
     </div> 
warning: squelched 13 whitespace errors 
warning: 18 lines add whitespace errors. 
Falling back to patching base and 3-way merge... 
error: Your local changes to the following files would be overwritten by merge: 
    app/views/entries/_entry_form_activity.html.erb 
    app/views/entries/_entry_form_employee_info.html.erb 
    app/views/entries/_entry_form_other_info.html.erb 
    app/views/entries/_entry_form_production_info.html.erb 
    app/views/entries/_entry_form_time_codes.html.erb 
    app/views/entries/create.js.erb 
    app/views/entries/edit.html.erb 
Please, commit your changes or stash them before you can merge. 
Aborting 
Failed to merge in the changes. 
Patch failed at 0002 Introduce DailyLog 
The copy of the patch that failed is found in: 
    /home/slopeuser/Documents/dev/estat/.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". 
+0

你的工作目录是否干净?错误是告诉你,git找到的文件没有提交,他们会丢失。 – blashser

+0

是的,这也是我的错误听起来像。开发和功能分支都通过'git status'进行检查,并且没有未提交的更改。 – CodeSmith

+0

是的,但是你可以在你的'.gitignore'中有这些文件(我猜测)你没有看到它们在'git status'中,但它们存在。然后,当git尝试创建这些文件时,它会报告错误。试试这个:用两个分支克隆你的repo,并在一个新的“干净”回购中尝试rebase。 – blashser

回答

0

我仍然不知道为什么变基失败,但我想我在查看rebase documentation后可能找到了解决方法。事实证明,您可以通过-s选项将合并策略传递给rebase命令。

我取消当前遇事底垫做:

git rebase --abort 

然后重新运行使用不同的合并策略底垫:

git rebase develop -s resolve 

所有提交预期这次重建基础。

1

您似乎有一些空白的错误,你的不同来解决它可能被忽略空格,试图找到“显示空白”设定您所使用的不同。

你可以试着让混帐通过与空格设置修补处理这个问题,在这里看到了一个类似的问题: git, whitespace errors, squelching and autocrlf, the definitive answers

+0

我不认为这是问题所在。我查看了你的链接并添加了一个配置选项来解决空白问题。现在Git修复空白问题,但仍然失败。我认为这是更重要的一行错误:对以下文件的本地更改将被merge覆盖:“rebase似乎不喜欢develop分支想要重新引入在功能分支中移动的文件的事实。 – CodeSmith

相关问题