Vagrant中共享文件夹的Git问题

Vagrant中共享文件夹的Git问题,vagrant,virtualbox,centos6,Vagrant,Virtualbox,Centos6,我以前在使用Vagrant时从未见过这个问题,所以我希望这对某些人来说是有意义的。我有一个包含git存储库的文件夹,该存储库正在与运行CentOS 6.5的流浪机器同步,并且发现与git存在一些不一致之处 在我的主机(Mac OSX)上,如果运行git status,我会得到以下信息: ~/Folder/repo$ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to

我以前在使用Vagrant时从未见过这个问题,所以我希望这对某些人来说是有意义的。我有一个包含git存储库的文件夹,该存储库正在与运行CentOS 6.5的流浪机器同步,并且发现与git存在一些不一致之处

在我的主机(Mac OSX)上,如果运行
git status
,我会得到以下信息:

 ~/Folder/repo$ git status
 On branch master
 Your branch is up-to-date with 'origin/master'.
 nothing to commit, working directory clean
vagrant@localhost ~/repo$ git status                                                                                                                 master
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .codeclimate.yml
#   modified:   .gitattributes
#   modified:   .gitignore
#   modified:   CONTRIBUTING.md
#   modified:   app/commands/.gitkeep
#   modified:   app/commands/CreateModule.php
#   modified:   app/commands/FbAdRevenue.php
....
但是如果我在我的“流浪者”框中运行相同的命令,我会得到以下结果:

 ~/Folder/repo$ git status
 On branch master
 Your branch is up-to-date with 'origin/master'.
 nothing to commit, working directory clean
vagrant@localhost ~/repo$ git status                                                                                                                 master
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   modified:   .codeclimate.yml
#   modified:   .gitattributes
#   modified:   .gitignore
#   modified:   CONTRIBUTING.md
#   modified:   app/commands/.gitkeep
#   modified:   app/commands/CreateModule.php
#   modified:   app/commands/FbAdRevenue.php
....
vagrant@localhost~/repo$git状态主机
#论分行行长
#已更改但未更新:
#(使用“git add…”更新将提交的内容)
#(使用“git签出--…”放弃工作目录中的更改)
#
#修改:.codecclimate.yml
#已修改:.gittattributes
#修改:.gitignore
#修改:contribution.md
#修改:app/commands/.gitkeep
#修改:app/commands/CreateModule.php
#修改:app/commands/fbadrevence.php
....

列表还在继续,基本上git认为每个文件都被修改了,没有提交,这是不正确的。知道为什么会出现这种情况以及如何解决吗?

根据运行
diff
后的信息,服务器上的文件权限似乎已更改

使用以下命令忽略权限

git config core.filemode false


1)确保您的OSX机器已设置为查看远程主机以获取更新
git remote-v
2)执行本地差异
git diff HEAD^^
并查看它认为发生了什么变化。有时时区问题可能会导致您的所有文件显示为不同的。很高兴继续项目1@NeerPatel。运行git diff命令,它唯一显示的是模式已从100644更改为100755I实际上在我的Vagrant box中更改了一些配置,问题得到了解决。但既然你的解决方案也能起作用,我会尝试将此标记为已接受的问题。@HunterSkrasek-谢谢!你能在修复后发布你自己的答案吗?@HunterSkrasek你介意分享一下你调整了什么样的流浪配置,让它在不改变Git配置的情况下工作吗?我们坐在座位的边缘想知道!:]我会努力的,这就像一岁的孩子,真的忘了我做了什么。