Git显示其他项目的变化

时间:2012-05-06 18:21:47

标签: git

我的/ rails目录中有三个项目:test_app /,dma4 /和test2_app /。我目前正在使用test_app /目录(已经为git初始化)并提交了更改。提交后,我做了一个'git status'来查看更改。出于某种原因,它告诉我没有变化,除了../dma4和../test2_app这些是其他项目!!

为什么它会告诉我当前项目之外的变化?我不应该忽略我的.gitignore文件中的其他项目...

这是确切的信息:

test_app $ git status
# 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)
#   (commit or discard the untracked or modified content in submodules)
#
#   modified:   ../dma4 (modified content)
#   modified:   ../test2_app (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")
test_app $ 

这些其他项目不是当前项目的子文件夹,这是heirarchy的外观:

导轨/ test2_app 导轨/ DMA4 轨道/ test_app

为什么会这样做?

1 个答案:

答案 0 :(得分:1)

您在目录树中将Git存储库初始化了一个级别太高。如果你上升一级并执行ls -a,那么你可能会在那里看到.git

尝试进入项目的实际文件夹,然后在那里进行git init