我無法將「taget」目錄添加到「.gitignore」文件。我做壞事:-(我無法將目錄添加到.gitignore
[email protected]:~/git/gitRepo$ tree -L 3 -a
.
├── .git
...
├── .gitignore
└── MyProject
├── .classpath
├── pom.xml
├── .project
├── .settings
...
├── .springBeans
├── src
│ ├── main
│ └── test
└── target
├── classes
├── m2e-wtp
└── test-classes
269 directories, 32 files
[email protected]:~/git/gitRepo$
[email protected]:~/git/gitRepo$ cat .gitignore
*.*~
*.class
*.jar
*.war
*.ear
MyProject/.classpath
MyProject/.project
MyProject/.settings/
MyProject/target/
/MyProject/target/
target
[email protected]:~/git/gitRepo$
[email protected]:~/git/gitRepo$ git status
# On branch master
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: .gitignore
# modified: MyProject/.settings/org.eclipse.wst.validation.prefs
# modified: MyProject/target/classes/log4j.xml
# modified: MyProject/target/m2e-wtp/web-resources/META-INF/MANIFEST.MF
# modified: MyProject/target/m2e-wtp/web-resources/META-INF/maven/example.net/gitRepo/pom.properties
# modified: MyProject/target/m2e-wtp/web-resources/META-INF/maven/example.net/gitRepo/pom.xml
#
no changes added to commit (use "git add" and/or "git commit -a")
[email protected]:~/git/gitRepo$
「MyProject的/的.classpath」被忽略列表,但我還是在「混帳地位」 MyProject的/目標*和MyProject的/ .settings看到。 能否請你幫我我做什麼不好? 謝謝!
可能重複(http://stackoverflow.com/questions/1139762/gitignore文件 - 不忽略) – poke