0

I follow these steps to ignore some directory in my Git :

  1. I've create a .gitignore file (outside my .git directory)
  2. I've add my ignored directories and files
  3. I've add my .gitignore file onto my git index by "git add .gitignore"

But when I check my status, git always want to add directories and files I want to ignore...

My .git and .gitignore location

My .git and .gitignore location

The file and directories I'd like to ignore

The file and directories I'd like to ignore, but which are not ignored by git

Can you help me to resolve this problem please ?

Tofuw
  • 908
  • 5
  • 16
  • 35
  • 3
    drop the trailing `/` and the wildcards. also what is that first line: `!.gitignore`?? – Vogel612 Nov 20 '15 at 16:42
  • 1
    This Might Work: http://stackoverflow.com/a/11451731/3319141: – Babul Prabhakar Nov 20 '15 at 18:34
  • @Vogel612 !.gitignore is apparently to "don't ignore" the file. – Tofuw Nov 23 '15 at 09:00
  • @BabulPrabhakar , I've tried "git rm -r --cached .", but still, it won't work. – Tofuw Nov 23 '15 at 09:01
  • 1
    @Tofuw As @Vogel612 already stated: You have to remove the `/` at the end of each line. – SevenEleven Nov 26 '15 at 18:38
  • Thank you all, for your help. I've tried all your methods, it didn't work because I had already added and commited all my files before creating the .gitignore file. To solve my problem I just had to erase and do a git init again. – Tofuw Nov 26 '15 at 22:44

0 Answers0