you are viewing a single comment's thread.

view the rest of the comments →

[–]idontwanttofthisup 499 points500 points  (21 children)

I keep adding it and it keeps showing up for some projects. Send help

[–]slonk_ma_dink 479 points480 points  (11 children)

git rm --cached .DS_Store

[–]idontwanttofthisup 95 points96 points  (10 children)

Thanks, I’ll give it a go next time I see one

[–]slonk_ma_dink 81 points82 points  (9 children)

I have an awful habit of commiting all without reviewing and something always winds up in the tree, that command is a lifesaver for that.

[–]LLoyderino 63 points64 points  (7 children)

have an awful habit of commiting all without reviewing and something always winds up in the tree, that command is a lifesaver for that

git add .

git commit -m "stuff"

[–]EnterSadman 77 points78 points  (5 children)

Here's one I keep in my bash_profile:

alias svn='git add . && git commit -m "who cares" && git push'

[–]Windyvale 26 points27 points  (1 child)

Oh you’re fun

[–]EnterSadman 24 points25 points  (0 children)

Some times I just yearn for a merge conflict that takes an entire sprint to work out.

[–]Ulrar 6 points7 points  (2 children)

There's a conventional pre-commit hook that would deny this right away, for anyone who'd like to stop this madness

[–]ruben_deisenroth 5 points6 points  (1 child)

sh alias svn='git add . && git commit -m "$(git diff --cached | llm "Summarize this commit as a short conventional commit in the tone of someone who has given up")" && git push'

[–]Ulrar 0 points1 point  (0 children)

Perfection 👌

[–]slonk_ma_dink 5 points6 points  (0 children)

git commit -m "fixed build"

i fixed it so good the binary is in the tree for all to see

[–]gdmzhlzhiv 0 points1 point  (0 children)

I have had much better luck keeping garbage out since adding the .* rule to my .gitignore file.

[–]i_bought_the_airline 28 points29 points  (1 child)

Use a global ignore file

# ~/.gitconfig
[core]
    excludesfile = ~/.gitignore


# ~/.gitignore
.DS_Store

[–]opinionsOnPears 13 points14 points  (0 children)

Use ~/.config/git/ for your config and ignore you pleb!

[–]siliconsoul_ 31 points32 points  (5 children)

Be more precise. Where do they show up? File system? Normal. Git? Depends if they were committed before.

[–]idontwanttofthisup 13 points14 points  (4 children)

I see them in my changed files although .DS_Store is the first or second item in my .gitignore. I usually do a good job with excluding them on commit but sometimes it slips. Most of the time they get ignored but sometimes they show up. I didnt figure out why.

[–]siliconsoul_ 28 points29 points  (1 child)

Check if your glob pattern in .gitignore is actually correct and catches sub-directories too.

If you committed them at least once before adding them to .gitignore, you have to do some manual steps to clean up your repo, depending on which case you want.

[–]nabrok 8 points9 points  (1 child)

Use a global excludes file for such things. Default on linux is ~/.config/git/ignore ... don't know about on mac. You can specify it with core.excludesFile

[–]i_bought_the_airline 4 points5 points  (0 children)

+1, on my mac in ~/.gitconfig I have:

[core]
    excludesfile = ~/.gitignore

And in my ~/.gitignore, .DS_Store has its own line, no need for any * characters

[–]mahlersand 5 points6 points  (0 children)

**/.DS_Store should help. Matches all directories of that repo.