Hacker News new | ask | show | jobs
by konsumer 4152 days ago
I do this if I forget to add .DS_Store to .gitignore when working with git repos: find . -name .*DS_Store -delete
3 comments

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

    cat >> ~/.config/git/ignore
    .DS_Store
    .AppleDouble
    .LSOverride
    .AppleDB
    .AppleDesktop
    .apdisk
    .fseventsd
    .Trashes
    .Spotlight-V100
    ._*
    Icon
    Network Trash Folder
    Temporary Items
    Icon
Why not .* ?

I can't think of a good reason to commit hidden files.

you have missed

mkdir -p ~/.config/git

Just be careful. A coworker of mine did this recently and forgot the -name part. Accidentally deleted everything, including the .git directory. He sure wished he had pushed that day.
*that hour.

Surely you don't cruise through to the end of a day without pushing at least once before lunch? :(

I commit often, rewrite mercilessly, and thus I push to the big server infrequently. I do push frequently between local machines and servers. Mercurial Evolve makes propagating these edited commits across my local servers quite nice.

Anyways, besides the plug for hg, my point was that I would expect pushing could be a once-a-day kind of thing, whereas commits should be every five minutes. :-)

I agree. Pushing too frequently means you can't rebase and reorganize your commits - unless you each use separate repos.
put stuff like this in your global gitignore and you will bever have to worry about these files again. Stuff like this does not belong in a projects gitignore anyway because it's system specific.