0

I'm tracking my home folder using a git repository. After doing git status, I'm getting this:

# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   workspace/
no changes added to commit (use "git add" and/or "git commit -a")

Why that line is shown? Here is my .gitignore file:

*
!*/
!.vim/plugin/*
!.vim/doc/*

I had to add the !*/ to track the changes inside .vim/plugin for example, as I saw here.

Community
  • 1
  • 1
tirenweb
  • 30,963
  • 73
  • 183
  • 303

1 Answers1

2

You're ignoring everything with the first line: '*'.

Then you're unignoring directories with the second line: '!*/'.

Voila, you're not ignoring directories!

Kylo
  • 322
  • 1
  • 7
  • yes, but i have more directories in my home folder. Why that folders are not also shown? – tirenweb Nov 16 '12 at 17:44
  • My guess is either those directories are already being tracked by git, or they're empty. Could that be it? – Kylo Nov 16 '12 at 17:51
  • @Kilo yes there are already being tracked by git some of them. Could that be the reason?? – tirenweb Nov 16 '12 at 17:53
  • 1
    @tirengarfio, the portion of the git status output that you've snipped in your question is the **Untracked** files section. So, yes, **tracked** directories won't be shown there. – Kylo Nov 16 '12 at 17:57
  • Take special notice that .gitignore DOES NOT AFFECT tracked files at all. Nothing. Nada. You can manually add an ignored file to the index (using git add) and from then on it will not be ignored when changes are made to it. – MattJenko Nov 17 '12 at 12:17