[terminal] recursively delete .DS_Store in terminal

I noticed that my git repository has .DS_Store files.
The .DS_Store file is used by Mac OS.

As I wanted not to include these files in my repository,
I tried to delete these as follow way.

First, I deleted all .DS_Store files in the directory recursively on terminal.

find . -name '.DS_Store' | xargs rm

Next, I created ~/.gitignore_global file.

update 26th Dec. 2011
I have to type this command

git config --global core.excludesfile ~/.gitignore_global

I wrote these strings in it.
The file is global settings in git.
If you specify a setting in certain directory, you can create .gitignore file in the directory.
It stops to add to stage of git the files in which are wrote.

# OS generated files #
######################
.DS_Store*
ehthumbs.db
Icon?
Thumbs.db

Finally I committed this state.

I referred these sites. Thanks.
>> フォルダ以下を再帰的にgrep検索する方法 – gorton-lab 日記の下書き
>> Help.GitHub – Ignore files

Tags: ,

Comments are closed.