开发者

git clean -X behaviour when .gitignore has sub-directory entries

When using sub-directory entries in .gitignore, "git clean -X" doesn't clean the ignored sub-directory.

$ git init test
Initialized empty Git repository in /home/jpgariep/git/test/.git/开发者_如何学JAVA
$ cd test/
$ mkdir -p a/b/c
$ touch a/b/c/test
$ echo '/a/b/' > .gitignore
$ git add .gitignore
$ git commit -m "Added .gitignore."
[master (root-commit) 94e2825] Added .gitignore.
 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 .gitignore
$ git status
# On branch master
nothing to commit (working directory clean)
$ git clean -X -d -f
$ ls a
b

Why is b still there?

Git version: 1.7.2.3

NOTE: This was also posted on the git mailing list 2 months ago without answer.


Apparently, it's a bug.

http://marc.info/?l=git&m=128561999924671&w=2

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜