git rebase失败 - 最终删除文件

时间:2014-12-10 22:20:11

标签: git azure-devops rebase

我有时在尝试改变时会遇到一些奇怪的事情。 rebase失败,我的一个更改的文件最终被标记为已删除。

有人可以帮我理解发生了什么吗?

这是最令人反感的事件:

我已经为一个新的功能分支做了几个本地提交:

C:\source\project [remove-index-html-from-urls]> git ll
97d1af8 (HEAD, remove-index-html-from-urls) Removed unused code [Vegar Vikan]
18      31      WebApiRole/Controllers/HomeController.cs

6115cd1 Do not redirect to index.html - just serve. [Vegar Vikan]
2       14      WebApiRole/Controllers/HomeController.cs
2       2       WebApiRole/app/app.js

586f67a (master) Merge branch 'unique-requestid-for-logging' [Vegar Vikan]

然后我取了主人......

C:\source\Webrapportering-Git [remove-index-html-from-urls]> git fetch origin master
remote: Microsoft (R) Visual Studio (R) Team Foundation Server
Unpacking objects: 100% (5/5), done.
From https://finale.visualstudio.com/DefaultCollection/_git/Finale
 * branch            master     -> FETCH_HEAD
   af56971..b4bb100  master     -> origin/master

......在我发起变基之前:

C:\source\Webrapportering-Git [remove-index-html-from-urls]> git rebase origin/master
First, rewinding head to replay your work on top of it...
Applying: Do not redirect to index.html - just serve.
Using index info to reconstruct a base tree...
<stdin>:29: trailing whitespace.
             */
<stdin>:45: trailing whitespace.
        });
warning: 2 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:
        WebApiRole/Controllers/HomeController.cs
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 Do not redirect to index.html - just serve.
The copy of the patch that failed is found in:
   c:/source/Webrapportering-Git/.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".

C:\source\Webrapportering-Git [(b4bb100...)|REBASE +0 ~1 -1]> git status

在这里你可以看到事情已经消失了......#/ p>

C:\source\Webrapportering-Git [(b4bb100...)|REBASE +0 ~1 -1]> git status
rebase in progress; onto b4bb100
You are currently rebasing branch 'remove-index-html-from-urls' on 'b4bb100'.
  (all conflicts fixed: run "git rebase --continue")

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   WebApiRole/Controllers/HomeController.cs
        deleted:    WebApiRole/app/app.js

no changes added to commit (use "git add" and/or "git commit -a")

正如您所看到的,git如何决定删除我的某个文件。为什么? 它试图应用的补丁文件没有提到任何删除?

它提到的冲突,将被覆盖的局部变化,也是一个谜,我的回购在变革之前是清洁的。

任何线索?

(中止反叛并重新开始通常做法)

0 个答案:

没有答案