3

这是我第一次尝试了解 git rebase 是如何工作的。我在新分支上做了很多更改,然后我尝试git rebase了,结果我得到了下一个输出:

$ git rebase master
First, rewinding head to replay your work on top of it...
Applying: new features done
/sandbox/.git/rebase-apply/patch:2825: trailing whitespace.
    var upl_div = document.getElementById('upload_form');
/sandbox/.git/rebase-apply/patch:2826: trailing whitespace.
    var crt_div = document.getElementById('create_form');
/sandbox/.git/rebase-apply/patch:2827: trailing whitespace.
    var appl_div = document.getElementById('create_letter');
warning: squelched 309 whitespace errors
warning: 314 lines add whitespace errors.
Using index info to reconstruct a base tree...
<stdin>:2825: trailing whitespace.
    var upl_div = document.getElementById('upload_form');
<stdin>:2826: trailing whitespace.
    var crt_div = document.getElementById('create_form');
<stdin>:2827: trailing whitespace.
    var appl_div = document.getElementById('create_letter');
warning: squelched 310 whitespace errors
warning: 309 lines applied after fixing whitespace errors.
Falling back to patching base and 3-way merge...
Auto-merging lib/functions_common.inc
Auto-merging .htaccess
Applying: new features done

而且我不明白它是否成功制作?它被重新定位或合并?发生了什么?我怎么能看到这些警告?

4

1 回答 1

5

当你做一个 rebase 时,git 会接受一堆提交,并尝试应用每个提交的更改依次引入。(换句话说,它就像 . 的一系列使用git cherry-pick。)这些重新应用程序中的每一个都可以使用 git 的合并机制来尝试通过将更改重新应用到新父级来解决可能出现的任何冲突。

所以,是的,你刚刚做了一个 rebase,但是 rebase 的每一步都可能涉及使用 git 的代码进行合并。

“尾随空格”警告告诉您应用更改在末尾添加了一些带有空格的行。git 对此很敏感(显然因为它可能会导致通过电子邮件发送的补丁出现问题),并且会在各种情况下警告您此类空白。“压制”错误只是说,与其打印出数百个此类警告,不如将它们压制为一行。

于 2012-10-22T08:55:03.593 回答