tags:

views:

474

answers:

3

Hi,

I'm trying to create a new git repository from existing folder. I've created a .gitignore file in the root of the folder. But if I say 'git add *' 'git commit' 'git push' files that should be ignored still get commited to the remote repository. I'm on Windows. Also I've bought a license for SmartGIT. It also seems to ignore .gitignore. I have to manually select which new files to commit.

What am I doing wrong?

+1  A: 

Probably your exclude file mask is inacurate.

takeshin
I've copied .gitignore file from another project, where it works.
John Grey
Is .gitignore accessible to git user? Maybe it's a permission issue?
takeshin
+3  A: 

Are your files already tracked? .gitignore only silences comments about untracked files, but won't stop a tracked file from being tracked.

Randal Schwartz
No, I've tried a few times with fresh new repositories.
John Grey
A: 

Try "git add ." instead.

Also, it works for me (on Linux):

$ git init
$ echo foo > .gitignore
$ echo foo > foo
$ echo bar > bar
$ git add -v *
The following paths are ignored by one of your .gitignore files:
foo
Use -f if you really want to add them.
fatal: no files added
Jakub Narębski