English 中文(简体)
身份恢复致命: 并不是一个宝库,而是存在,欧洲复兴开发银行有适当的许可。
原标题:git status returns fatal: Not a git repository but .git exists and HEAD has proper permissions
  • 时间:2012-04-13 15:51:25
  •  标签:
  • git

在我收到<密码>后,我获得特惠地位: 不设一个宝库:

我检查并检查了。 我可以处以其他各种指挥罚款。 如果我开了 g,就会开脱,把几个已改变的档案列入其中,但其中很多人失踪。

我猜测,欧洲竞争和消费者保护局可能出现某种腐败。 如何在不去掉整个背心的情况下解决这一问题的想法?

最新消息:我认识到我改变了诗歌的名称。 错误中提及的名录是名录的老名称。 因此,我现在的重新编号为/new dir/.git,但错误为。 不设一个储存库: /old dir/.git/modules/docs。 因此,可能会混淆起来?

最佳回答

最后,我指出,这个问题是由于与其中一个小阶层的问题。 简而言之,重新命名邮局造成与该邮局的冲突。 https://stackoverflow.com/questions/9878860/how-can-i-rename-a-git-reito-with-submodules” 我怎么能够重新命名一个有子宝藏的宝库? 我认识到,改用克隆技术是一种更好的途径,而不是重新命名目录,而是用分层解决问题。

问题回答

这两份文件载有绝对分层办法:

{submodule}/.git
.git/modules/{submodule}/config

因此,如果你搬回邮袋,这两份文件的绝对道路是站不住脚的,不会造成仓储的错误。 仅用人工确定这些档案。

Former versions of git used an absolute path to locate the gitdir of a submodule. The solution is as follows:

  1. Upgrade git to the latest version. Some says you ll need at least version 1.7.10. I just successfully solved the issue with git 1.8.3.
  2. Delete all the broken submodule folders: rm -rf broken_submodule_folder
  3. Update the registered submodules: git submodule update. You should see the submodules being checked out.

在我的案件中,问题是任何地方的.口/HEAD文件,只是含有一系列奇怪的特性。 我复制了git/ORIG_HEAD至 .git/HEAD的内容,并再次开展工作。

Source

我通过重新设置所有精子子来解决这一问题。

rm -rf .git/modules
git submodule update --init

解决办法:

1) Look into the HEAD file (under .git) -> If it is corrupted (contains some random values), replace the content with this text ref: refs/heads/develop (develop is the last branch I was working on)

(2) 尝试——身份。

3) 如果第2步没有解决你的问题,就尝试这些指挥(可能不是为所有人工作,而是值得尝试)

rm -f .git/index git reset

4) git will give you unstaged files after reset. keep or discard as per your wish

我也与分专题组一道面对这一问题,但在分析了这两个档案之后。

{submodule}/.git .git/modules/submodules/{submodule}/config

我认识到,就我而言,这不是一个问题。

在进行了一些研究后,我发现,在我的案件中,我不得不增加一些格特(共同点:模块添加了格特)和错误消失。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签