Radolino
Radolino

Reputation: 1844

Ignore OSX hidden "._" files from git repo

I git add . everything to my repo, excluding files and directories (its a Rails 4+ one). I see a bunch of hidden files starting with a dot (some including an underscore) and I need to ignore them so they won't get pushed every time. I am working from an OSX Yosemite macbook. How do I do that? Is it simple regEx ^._* ?

Upvotes: 4

Views: 3882

Answers (2)

Hyeonseo Yang
Hyeonseo Yang

Reputation: 1128

I think adding

._*

In .gitignore file will do the trick.

Upvotes: 0

Gorcyn
Gorcyn

Reputation: 2817

You can use the .* to make him ignore all hidden files (starting with a dot).

So you can add to your [PROJECT]/.gitignore file:

.*
!/.gitignore

The second line is here to keep the .gitignore file.

Upvotes: 3

Related Questions