2012-05-06 47 views
0

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

为什么它会告诉我有关当前项目之外的更改?我不应该忽视其他项目在我的.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 $ 

这些其他项目不子文件夹的当前项目,这里的层次结构的外观:

轨/ test2_app 轨/ DMA4 轨/ test_app

它为什么要这么做?

+0

'git rev-parse --show-toplevel'的输出是什么? –

+0

我希望我尝试了你的命令,但在刷新stackoverflow之前,我做了ls -la ../,并在所有应用程序的父目录中看到了.git!一些我错误地运行'git init'。在父目录里面! – dingalingchickenwiing

回答

1

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

尝试进入您的项目的实际文件夹,并在那里做git init

+0

就是这样 - 在父目录中只是'rm -rf .git'安全吗?不知道git是否在项目子文件夹的其余部分添加了更多'.git'文件夹,尽管我没有找到任何文件夹。 – dingalingchickenwiing

+0

是的,它是安全的(假设你不关心任何保存的提交或者什么) - Git在一个.git目录中是非常独立的。 – Amber

相关问题