首页 文章

在VirtualBox共享文件夹中尝试签出时Git结帐失败

提问于
浏览
2

我已经将一个存储库克隆到我的Windows 7桌面上 . 我已将存储库设置为我的VirtualBox机器中的共享文件夹( Ubuntu 14.04 ) . 所以现在我可以在我的Ubuntu VBox机器上访问这个文件夹了 .

当我尝试执行 git checkout branch-v1 时,它说:

error: The following untracked working tree files would be overwritten by checkout:
path/to/file/foo.java
Please move or remove them before you can switch branches.
Aborting

但是,当我回到我的Win7主机,打开cygwin并做 git checkout branch-v1 时,它运行正常 .

那么,我怎样才能在没有这个问题的情况下结账?

注意:我没有处理 foo.java 文件 . 它没有在文本编辑器中打开或类似的东西 .

1 回答

  • 0

    看起来像行结尾的问题 . 试试 git config --global core.autocrlf true

    github上的指南:Dealing with line endings

相关问题