Git rebase失败,'您对以下文件的本地更改将被合并覆盖'.没有本地变化?

jho*_*orn 97 git git-rebase

这是我的脚本,试图将我的bugfix分支合并到我的主分支上,准备将其推向上游.自bugfix分支创建以来,已经有一些上游更改被拉入master,现在它拒绝rebase.

它抛出错误的文件在打开时不会被分散.没有添加,删除或重命名的文件.没有任何东西被忽略,没有任何东西没有被追踪或上演或未分期.我完全不知道为什么rebase失败了.

我在OS X 10.6.6和git 1.7.4上

.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git rebase bug586-test master-test
First, rewinding head to replay your work on top of it...
Applying: - comiitting code related to api permissions
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
error: Your local changes to the following files would be overwritten by merge:
    inc/data.inc
    templates/apipermissions_tpl.inc
    templates/currencies_tpl.inc
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 - comiitting code related to api permissions

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git status
# Not currently on any branch.
nothing to commit (working directory clean)



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git rebase --abort
HEAD is now at 5efccf1 - comiitting code related to api permissions



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git log -n10 --oneline
5efccf1 - comiitting code related to api permissions
a8a5ee4 Style changes for IE
cfca618 Style changes for IE
8a69de6 Style changes for IE
8946585 - comiitting code related to api permissions - fixed an html error in the currencies template
5fba0a9 Merges the 1.11b branch bugfixes and changes into trunk
ef57049 Andrew Commiting on Blakes behalf on changes he made to transfers; Also an Indue GW balance fix; debitcarupload fix for LSN
69e4313 Fixed an issue with Support From email
9058fb6 Sets the svn property svn:eol-style to LF, to enforce unix style line endings
240839e Fixes up a lot of the whitespace issues.



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git checkout bug586-test 
Switched to branch 'bug586-test'



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git log -n10 --oneline  
b7b1f8a Resolves #586, Postback on deposit
5fba0a9 Merges the 1.11b branch bugfixes and changes into trunk
ef57049 Andrew Commiting on Blakes behalf on changes he made to transfers; Also an Indue GW balance fix; debitcarupload fix for LSN
69e4313 Fixed an issue with Support From email
9058fb6 Sets the svn property svn:eol-style to LF, to enforce unix style line endings
240839e Fixes up a lot of the whitespace issues.
cf27b6f - bug that came up with transferring. The transfer page had a hidden field called to, which was taking precedence over cards and usercard which would throw the system out a bit
7c21a81 Fixes #603, new add transaction form, journalled.
01e6292 Removes a pile of resource forks
880c5bc - bug that came up with transferring. The transfer page had a hidden field called to, which was taking precedence over cards and usercard which would throw the system out a bit



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git rebase master-test bug586-test
First, rewinding head to replay your work on top of it...
Applying: Resolves #586, Postback on deposit
Using index info to reconstruct a base tree...
<stdin>:52: trailing whitespace.
                'name' => 'Invoice Transfer Out', 
<stdin>:175: 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:
    templates/deposit_tpl.inc
Please, commit your changes or stash them before you can merge.
Aborting
Failed to merge in the changes.
Patch failed at 0001 Resolves #586, Postback on deposit

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".



.-(/Volumes/joshua/www/txfunds)-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------(joshua@Kusanagi)-
`--> git rebase --abort
HEAD is now at b7b1f8a Resolves #586, Postback on deposit
Run Code Online (Sandbox Code Playgroud)

jho*_*orn 184

这是我的另一个问题的答案.

我在Mac上,这个模糊的配置更改似乎解决了我没有关于无阶段更改的困境.

git config --global core.trustctime false
Run Code Online (Sandbox Code Playgroud)

我认为这与Windows文件时间,linux文件时间和mac文件时间之间的差异有关.谁知道,如果你这样做,请随时发表评论.

更新:此博客文章解释了正在发生的事情.

  • 以下是对原因的解释http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/#!看起来它与修订后台进程有关. (5认同)

use*_*837 46

关于Joshua Hogendorn的回答:在我看来,在使用git处理存储库时让Xcode处于打开状态会导致这些问题.它甚至导致了一种情况,git提交了一些我认为已存在的东西(之后仍然存在),但Xcode只是在rebase期间写入文件系统.

所以:如果你想要安全的话,在使用git处理repo之前关闭你的Xcode项目,然后你可能不需要core.trustctime false设置.

  • 我尝试过……并为我工作!在进行重新设置基准之前,请关闭xcode。浪费很多时间一无所有。谢谢 ! (3认同)
  • 在Visual Studio 2013中打开项目时遇到同样的问题.关闭项目解决了问题. (3认同)
  • 更一般地说,这似乎是在rebase期间锁定文件的问题.对我来说,这是`webpack --watch`正在运行. (3认同)
  • 我关闭了Visual Studio Code以解决我的问题 (2认同)