git repo 出现奇怪的问题?

发布于 2024-12-03 01:41:56 字数 2101 浏览 0 评论 0原文

我刚刚在 Mac 上升级到 OSX Lion,并且在 git 存储库中遇到了一个奇怪的问题。我的 .vim 文件处于版本控制之下,其中许多插件配置为 git 子模块。升级后,我在 .vim 目录中运行 git status 命令并得到以下信息:

fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed

有人知道我的问题是什么吗?我在Google和SO上搜索了上述错误消息,但没有找到任何答案。我还注意到 git 现在似乎很慢。另外,我在其他 git 存储库中没有其他问题(预计缓慢问题),这让我认为该问题与 Lion 无关。有人对如何修复我的 .vim 存储库有任何建议吗?预先感谢您的帮助。

以下是 drizzd 请求的一些跟踪输出:

setup: worktree: /Users/sbrown/.vim/bundle/supertab  
setup: cwd: /Users/sbrown/.vim/bundle/supertab  
setup: prefix: (null)  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  
setup: git_dir: .git  
setup: worktree: /Users/sbrown/.vim/bundle/surround  
setup: cwd: /Users/sbrown/.vim/bundle/surround  
setup: prefix: (null)  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  
setup: git_dir: .git  
setup: worktree: /Users/sbrown/.vim/bundle/tasklist  
setup: cwd: /Users/sbrown/.vim/bundle/tasklist  
setup: prefix: (null)  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  
setup: git_dir: .git  
setup: worktree: /Users/sbrown/.vim  
setup: cwd: /Users/sbrown/.vim  
setup: prefix: bundle/vim-colors-solarized/  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  

I just upgraded to OSX Lion on my Mac and I aquired a strange problem with a git repo. I have my .vim files under version control with a number of plugins configured as git submodules. After upgrading, I ran a git status command into my .vim directory and got the following:

fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed
fatal: git status --porcelain failed

Does anyone know what my problem is? I searched the above error message on Google and SO, but I didn't find any answers. I've also noticed that git seems to be very slow now. Also, I have no other problems in other git repos (expect the slowness problem), which makes me think the problem is not related to Lion. Does anyone have any suggestions for how I can fix my .vim repo? Thanks in advance for the help.

Here is some of the trace output requested by drizzd:

setup: worktree: /Users/sbrown/.vim/bundle/supertab  
setup: cwd: /Users/sbrown/.vim/bundle/supertab  
setup: prefix: (null)  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  
setup: git_dir: .git  
setup: worktree: /Users/sbrown/.vim/bundle/surround  
setup: cwd: /Users/sbrown/.vim/bundle/surround  
setup: prefix: (null)  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  
setup: git_dir: .git  
setup: worktree: /Users/sbrown/.vim/bundle/tasklist  
setup: cwd: /Users/sbrown/.vim/bundle/tasklist  
setup: prefix: (null)  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  
setup: git_dir: .git  
setup: worktree: /Users/sbrown/.vim  
setup: cwd: /Users/sbrown/.vim  
setup: prefix: bundle/vim-colors-solarized/  
trace: built-in: git 'status' '--porcelain'  
trace: run_command: 'status' '--porcelain'  
trace: exec: 'git' 'status' '--porcelain'  

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

弥枳 2024-12-10 01:41:56

为了将来参考,我解决问题的唯一方法是删除所有子模块,然后重新安装它们。

For future reference, the only way I could correct the problem was to remove all submodules and then reinstall them.

与风相奔跑 2024-12-10 01:41:56

如果它对其他人有帮助,我刚刚遇到了同样的问题,并发现在项目根目录中运行 git init 修复了它。

In case it helps anyone else, I just encountered the same issue and found that running git init in the project root fixed it.

沩ん囻菔务 2024-12-10 01:41:56

您的 git 项目(或至少一个子模块,如果有的话)已损坏。这意味着您的 .git 文件夹中的某些文件已损坏或丢失。

修复 git-repo

正如 Jordan 提到的:转到根目录并运行 git init。然后再次尝试 git status

修复子模块

如果这不起作用,请导航到您的子模块文件夹并再次尝试 git init。返回根目录并运行 git status。

为什么它坏了?

一种答案可能是访问权限存在问题。也许您正在与多个用户一起处理工作副本?

另一个答案可能是某种同步软件,例如 OwnCloudDropboxGoogle Drive 或像我这样的 BitTorrent Sync。我的工作副本位于同步文件夹中,该文件夹在我的工作计算机和家里的计算机之间同步。这会导致一些权限问题。

希望有帮助。

Your git-project (or at least one of your submodules, if you have some) became corrupted. This means that some of the files in your .git-folder(s) are corrupt or missing.

Fix git-repo

As Jordan mentioned: Go to your root and run git init. Then try git status again.

Fix submodules

If this doesn't work, navigate to your submodule-folder(s) and try git init again. Go back to root and run git status.

Why is it broken?

One answer could be, that there are problems with the access-permissions. Maybe you're working with several users on the working copy?

Another answer could be some kind of sync-software like OwnCloud, Dropbox, Google Drive or like in my case BitTorrent Sync. My working copies are located in the sync-folder, which is synced between my computer at work and at home. This causes some issues with permissions.

Hope it helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文