0

I cannot get .gitignore to ignore a directory... I have read other threads and they are all suggesting the directory or file that is not being ignored has been committed, and that is why it's not ignored. This is not the case. Could you please take a look at what I am doing below and let me know what I am doing wrong?

I am sorry if I didn't format this correctly... I am new to stackoverflow.

$ mkdir stackoverflow_example
$ cd stackoverflow_example
$ git init
$ mkdir ignoreThis
$ echo "/ignoreThis" > .gitIgnore
$ cd ignoreThis
$ echo "ignore this text file in the ignoreThis directory" > ignoreText.txt
$ cd ..
$ type .gitignore /ignoreThis
$ git status 

On branch master

Initial commit

Untracked files: (use "git add ..." to include in what will be committed)

    .gitIgnore
    ignoreThis/

nothing added to commit but untracked files present (use "git add" to track)

Shouldn't ignoreThis not be listed in my staging area at this point.

androidevil
  • 9,011
  • 14
  • 41
  • 79
Dugan
  • 21
  • 3
  • have you tried the answer? – androidevil Apr 03 '15 at 13:10
  • Thank you for your response and for properly formatting my question. I just removed the file and created a file named .gitignore the same exact way, with the same results. Maybe I should mention I am on windows 7 and that it works on my mac? – Dugan Apr 03 '15 at 20:45
  • I did the same steps in Linux and it works properly. I did not tried in Windows. I don't know why you have this issue in Windows. In accordance with this question you are doing the right way - http://stackoverflow.com/questions/343646/ignoring-directories-in-git-repos-on-windows – androidevil Apr 04 '15 at 01:37

1 Answers1

0

Your file is named gitIgnore, try name it gitignore.

More info in here

androidevil
  • 9,011
  • 14
  • 41
  • 79