tags:

views:

55

answers:

1

WinXP + mysisGit1.7

In my .gitignore file, but still can't see Demos/path/to/file/file.cpp being tracked by git.

I have below entries:

Demos/
!Demos/path/to/file/file.cpp

The absolute path is: c:\Project\Demos\path\to\file\file.cpp

What could be wrong? Please help, thanks.


EDIT:

I found the way how mysisGit .gitignore work on WindowsXP can only ignore certain type of file, then exclude some files with same type. For example:

*.bak
!tracking.bak
!/path/to/file/tracking2.bak

It doesn't work ignore folder and exclude some files under that folder. Below won't work:

/folderUnderRepoRoot/
!/folderUnderRepoRoot/tracking.cpp

Nor

anyFolderNamedLikeThis/
!anyFolderNamedLikeThis/tracking.cpp
!/anyFolderNamedLikeThis/tracking.cpp

However, I do find that there's an exception. There's a work-around way to exclude files just right under the ignored folder (not to its subfolder). This works.

/folderUnderRepoRoot/*
/folderUnderRepoRoot/tracking.cpp

But this way is only limited when the file is not in any subfolder, so it's not so useful.

So I end up still commit most of source files, even I was only interested in a few files while tracking some others big project. Which means there're a bunch of files I won't touch but still need to commit them.

Here is another thread that had similar problem.

A: 

Can you try replacing it with !/Demos/path/to/file/file.cpp (note the leading slash after the exclamation mark) instead and try again?

Manoj Govindan
@Manoj, this doesn't work. Thanks though.
Stan