我的家(〜/)目录以某种方式被添加为我的git仓库的一部分,现在我无法将其删除

时间:2014-05-14 23:37:23

标签: git

我注意到我的git status突然包含了我的〜/ dir。当我做了git add . -A它包含了最近包含在目录中的一些文件。我不知道他们是如何到达那里的,但是当我打电话给git rm --cached ~/时它拒绝说:

fatal: /Users/me/: '/Users/me' is outside repository

如何从存储库中删除它?

更新:根据请求,这是我的git status输出:

On branch temp
Your branch is up-to-date with 'origin/temp'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    modified:   gradle.properties
    modified:   gradle/plugins/idea.gradle
    modified:   gradle/plugins/info.gradle
    modified:   gradle/plugins/stage.gradle
    modified:   myproject.gradle
    new file:   ~/NewDir/my.ear
    new file:   ~/NewDir/build.gradle
    new file:   ~/NewDir/deploy-grenade
    new file:   ~/NewDir/deployment/install_template.py
    new file:   ~/NewDir/deployment/uninstall_template.py
    new file:   ~/NewDir/gradle.properties
    new file:   ~/NewDir/gradle/wrapper/gradle-wrapper.properties
    new file:   ~/NewDir/gradlew
    new file:   ~/NewDir/gradlew.bat
    new file:   ~/NewDir/settings.gradle
    new file:   ~/NewDir/timestamp.txt

1 个答案:

答案 0 :(得分:1)

事实证明,目录“~”实际上是我的git存储库下的Dir,而不是实际的shell解析主目录。感谢@Paul Hicks提供了见解。