【发布时间】:2015-08-26 22:43:24
【问题描述】:
我正在尝试在我的开发分支之上重新设置功能分支,但我收到以下错误。我不确定,但我认为每当我将文件从一个文件夹移动到另一个文件夹时都会发生这种情况。它抱怨的那些文件没有在我重新建立基础的分支中进行任何更改,所以我不确定问题是什么。这最初发生在 git 2.2.2 中;我刚刚尝试升级到 2.5.0,但它仍在发生。
如果我忘记了变基,只是将我的功能分支合并到开发分支中,那么一切正常。 Git 将功能分支与开发分支合并没有问题。
有人对我如何完成变基有任何建议吗?我尝试使用 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".
【问题讨论】:
-
你的工作目录干净了吗?该错误告诉您 git 正在查找未提交的文件并且它们将丢失。
-
是的,这对我来说也是错误的。通过
git status检查了开发和功能分支,并且没有未提交的更改。 -
是的,但是您可以在
.gitignore中拥有这些文件(我猜)您在git status中看不到它们,但它们存在。然后当 git 尝试创建这些文件时,它会报告错误。试试这个:用两个分支克隆你的仓库,然后在一个新的“干净”仓库中尝试 rebase。
标签: git