1
$ git --version:  
git version 1.7.9.5

$ cat /etc/issue:  
Ubuntu 12.04.3 LTS \n \l

$cat .gitignore  
**/._*  
**/*.swp  
**/.DS_Store  
log/  
bak/  

$ git status  
On branch master  
Changes not staged for commit:  
(use "git add <file>..." to update what will be committed)  
(use "git checkout -- <file>..." to discard changes in working directory)  

modified:   html/conf/._conf.php  
modified:   html/conf/conf.php  

no changes added to commit (use "git add" and/or "git commit -a")  

As shown above, i included **/._* in my .gitignore.
I created the .gitignore first, then "git init" and finaly "git add .". I commited everything and then changed html/conf/conf.php. As you can see in the output of "git status" the ._conf.php is not ignored. Anyone here, who can help me with that? I read so many tutorials, but obviously i'm missing something.

Does "git add ." ignore the ignore-list? If so, what do i have to do to avoid that? New created files matching */._ are ignored correctly.

Trying "git update-index --assume-unchanged **/._*" results in
fatal: Unable to mark file doku/._blabla.txt

I'm running out of ideas ...

Thanks in advance!

  • I don't think `**/` is accepted shell glob syntax for subdirectories. As far as git goes, anyway. If you want to ignore dotfiles, just don't provide a path: `.*` – JB. Nov 11 '13 at 14:47

1 Answers1

2

.gitignore is taking into consideration only for new files.

If your files are already tracked by Git and then modified the changes should be staged with git add ..

You can set the status of these files to "assume unchanged" with:

git update-index --assume-unchanged <file>

http://gitready.com/intermediate/2009/02/18/temporarily-ignoring-files.html

Haralan Dobrev
  • 7,617
  • 2
  • 48
  • 66