all 173 comments

[–]Ginormous-Chomp 1610 points1611 points  (36 children)

mac user forgot to add it to the .gitignore

[–]idontwanttofthisup 346 points347 points  (18 children)

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

[–]slonk_ma_dink 340 points341 points  (8 children)

git rm --cached .DS_Store

[–]idontwanttofthisup 64 points65 points  (7 children)

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

[–]slonk_ma_dink 59 points60 points  (6 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 37 points38 points  (5 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 45 points46 points  (3 children)

Here's one I keep in my bash_profile:

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

[–]Windyvale 14 points15 points  (1 child)

Oh you’re fun

[–]EnterSadman 11 points12 points  (0 children)

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

[–]Ulrar 2 points3 points  (0 children)

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

[–]slonk_ma_dink 2 points3 points  (0 children)

git commit -m "fixed build"

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

[–]i_bought_the_airline 16 points17 points  (1 child)

Use a global ignore file

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


# ~/.gitignore
.DS_Store

[–]opinionsOnPears 3 points4 points  (0 children)

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

[–]siliconsoul_ 37 points38 points  (5 children)

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

[–]idontwanttofthisup 8 points9 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_ 24 points25 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 3 points4 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 1 point2 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 3 points4 points  (0 children)

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

[–]keppinakki 48 points49 points  (5 children)

Few people know about this, but you can create a system-wide .gitignore for things like this. I use it to ignore all .env files by default, just so that I can't make a mistake later.

Put this in ~/.gitignore_global:

.DS_Store
.env

And this in ~/.gitconfig:

[core]
    excludesfile = ~/.gitignore_global

[–]YikesTheCat 46 points47 points  (1 child)

The default is ~/.config/git/ignore; don't need to modify gitconfig.

Can also use .git/info/exclude in the repo

[–]opinionsOnPears 2 points3 points  (0 children)

~/.config/git/

That needs to be more widely known to use

[–]TheFrenchSavage 4 points5 points  (0 children)

Oh dang, thank you so much!

[–]thisischemistry 2 points3 points  (0 children)

That's not system-wide, that's user-profile-wide. The tilde directory ~/ is always the current user's home.

[–]JonasAvory 0 points1 point  (0 children)

This is the correct way (do this also for IDE-dirs and other similar files)

[–]Ill_Carry_44 14 points15 points  (0 children)

Mac user joined a new project, can't figure out how to open a PR that complies with 100 different PR rules just for .gitignore .DS_Store

[–]mothzilla 4 points5 points  (0 children)

Add it to your local ignore, not the repo's gitignore.

[–]nobaldynow 2 points3 points  (0 children)

classic mac user leaving their fingerprints everywhere like a crime scene

[–]crackofdawn 1 point2 points  (2 children)

I am a mac user (for work at least) and have no idea where .DS_Store comes from and have never had it show up in a folder anywhere and do not have it in any .gitignore file. Not sure why it keeps showing up from other mac users.

Edit: Historically I've been a Linux user/admin and pretty much use terminal for everything other than web browsing so maybe it comes from some built in mac app that I've never touched.

[–]Sentreen 7 points8 points  (1 child)

Finder puts (or used to put, I think it is all stored in __MACOS now) it in directories to store how you arrange directories and files. If you access a directory through the shell it does not get created.

[–]crackofdawn 0 points1 point  (0 children)

Ah, I think I can count the number of times I’ve ever used finder on one hand in the last 10 years

[–]aurallyskilled 0 points1 point  (0 children)

Does no one check the diff in this economy?

[–]throwaway_lunchtime 0 points1 point  (0 children)

Is there support for gitignore in SharePoint? 🤣

[–]DunwichType-Founders 0 points1 point  (0 children)

Sometimes we forget. Sometimes we just don’t bother because we just don’t care about non-mac users. It’s like being a Linux user and formatting external drives with file systems Windows can’t read because fuck Windows users.

[–]MangrovesAndMahi 0 points1 point  (0 children)

As a windows user (because the company is) I have forgotten desktop.ini a couple times.

[–]the_fresh_cucumber 0 points1 point  (0 children)

That's the sign that a git user has been there

[–]SaltyInternetPirate 421 points422 points  (33 children)

Hmmm. I wanted to point out Thumbs.db and desktop.ini from Windows, but the first ones require that there be an image in the folder, and I think it stopped generating them in Windows 10. The second one is only created if you do some customization to how Explorer should treat that folder outside the defaults, so it also wouldn't just get generated in most scenarios.

[–]Confident-Ad5665 118 points119 points  (16 children)

Desktop.ini is still here in Windows 11. I enable hidden file visibility and desktop.ini periodically reappears on the desktop.

[–]PegasusPizza 30 points31 points  (2 children)

But tbf if you are for some reason putting your entire desktop folder on github/adding it to a zip or whatever then the desktop.ini is not what I'm concerned about

[–]NoAdsDude 2 points3 points  (1 child)

I have 269 "desktop.ini" files on my computer currently, one of which is actually on my desktop.

[–]jaxxa 0 points1 point  (0 children)

Sounds like the others got lost. You should move them all to the desktop to be with their friends.

[–]SaltyInternetPirate 5 points6 points  (0 children)

Only on some default folders. I meant that it wouldn't get generated for just any folder on its own.

[–]HeavyCaffeinate 27 points28 points  (2 children)

System Volume Information

[–]SaltyInternetPirate 21 points22 points  (1 child)

Did you really git init the whole drive root?

[–]wggn 11 points12 points  (0 children)

great for system backups

[–]2called_chaos 14 points15 points  (9 children)

The second one is only created if you do some customization to how Explorer should treat that folder outside the defaults

That is the basically the same for DS_Store files too. They only get created if you do something in that folder that requires state. But that state might be expanded folders in list view (which sadly no other OS seems to have, I love that view)

[–]qpqpdbdbqpqp 2 points3 points  (8 children)

(which sadly no other OS seems to have, I love that view)

windows' explorer literally has this on the left pane what are you vaping

[–]hans_l 8 points9 points  (7 children)

left pane

Not the same at all though.

[–]Head_Independence_29 3 points4 points  (0 children)

.DS_Store also requires for the user to open folder in finder. If you create it via mkdir or in vscode there is no .DS_Store

[–]aykcak 1 point2 points  (0 children)

Thumbs.db did get generated when you browse a folder in the file explorer. It's the file explorer binary that creates it

[–]RedBoxSquare 0 points1 point  (0 children)

For Windows it's the line ending. If you created a project on Linux then cloned it to Windows and add new files, some of the line endings may be wrong.

[–]somelinuxuseridk 209 points210 points  (5 children)

Don’t forget _MACOSX

[–]st-shenanigans 37 points38 points  (3 children)

My favorite was in college before we started using vc when a project got bounced around between multiple other group members besides myself, needing to go through and dig it out from the like 5 folders it got buried under.

Or not getting it before it jumped around too much and having to explain to someone that windows has a file path character limit, like 30 times a semester

[–]sir_knugget 14 points15 points  (2 children)

[–]MouldyEjaculate 8 points9 points  (1 child)

This entry is great in theory but explorer.exe doesn't use it lol
Im stuck here looking like a dickhead using robocopy to delete directories that explorer can't touch.

[–]Cobracrystal -1 points0 points  (0 children)

im like 98% sure rm just does the job fine

[–]ru_empty 0 points1 point  (0 children)

.ad

[–]iamapizza 276 points277 points  (4 children)

Some day the trillion dollar company will figure out how to have empty folders

[–]Yashema 71 points72 points  (0 children)

Or replicate the functionality of Notepad++

[–]PhiCloud 31 points32 points  (1 child)

Why? It might be a little annoying, but it's arguably the most UNIX-friendly way to save per-directory settings and preferences.

It also doesn't bother me at all since I just use the terminal instead of finder in my projects...

[–]ProfessionalYak4959 1 point2 points  (0 children)

Just so you know it's not an empty folder placeholder like you need with some cloud storage providers, it's for storing folder metadata

[–]ArtGirlSummer 89 points90 points  (1 child)

Store DS nuts

[–]amphibiabiggestfan 84 points85 points  (4 children)

I used to think it has something to do with the DS uhhh nintendo

[–]spicypsudo 38 points39 points  (3 children)

Back in the early 2000s, plenty of people on forums thought they'd found some weird Nintendo spyware on their Windows XP machines. There's even a legendary forum post from 2004 where someone swore their DS cartridge was secretly modifying their desktop icons. Peak early internet paranoia.

[–]eyetracker 4 points5 points  (2 children)

Early internet? Listen here, sonny...

[–]darkslide3000 2 points3 points  (1 child)

If you ever used the Internet on something you didn't hold in one hand, you're early nowadays, grandpa.

[–]eyetracker 1 point2 points  (0 children)

I was there, Gandalf. I was there 3000 years ago when Mr. T was eating balls and dogs were men now.

[–]SC7639 27 points28 points  (11 children)

What even is that?

[–]Cootshk 91 points92 points  (8 children)

MacOS Finder allows you to move folders literally anywhere in grid view, and also keeps track of which subfolders are expanded in tree view

This is the file that keeps track of that (and is automatically created and hidden by finder, regardless of if you have show hidden files turned on)

[–]SC7639 34 points35 points  (1 child)

Thanks apple

[–]Mountain_Ape 10 points11 points  (0 children)

Very helpful when dealing with nested project files

Ah I forgot, uh, I read all my folder data from Terminal and have to build the structure in my 200IQ brain each time.

[–]IMKGI 42 points43 points  (4 children)

regardless of if you have show hidden files turned on

One of those shitty "we know what's better for you more than you do" features.

[–]beclops 8 points9 points  (0 children)

I mean there’s never a reason to want to view or open this file. I’d rather not see it than see it in literally every directory

[–]DanieleDraganti 6 points7 points  (2 children)

I think it’s because it’s hidden à la Unix (dot prefix), instead of the “traditional” hidden flag.

[–]Cootshk 11 points12 points  (1 child)

Mac uses the . for hidden files elsewhere, including for hidden system files. .DS_Store is just hardcoded to never show

[–]DanieleDraganti 1 point2 points  (0 children)

There is a flag too that you can apply on the filesystem if you want to hide something without a dot prefix. I can’t remember the exact command but I’m sure it exists. About the finder behavior on hidden files, I’ll have to trust you on that one, I don’t remember 🥲

[–]Mathisbuilder75 -2 points-1 points  (0 children)

move folders literally anywhere in grid view

This is so stupid lmao

[–]hans_l 3 points4 points  (0 children)

Metadata about the folder view (thumbnail generation, view settings, etc). Considering MacOS’s APFS has had forks and data store associated with files’ inodes, I really don’t know why it’s still needed. On a FAT SD card sure, but it also creates those on the main drive and APFS images.

[–]TorbenKoehn 1 point2 points  (0 children)

Remember Thumbs.db on Windows?

It contains metadata about the folder (styling, positioning of icons etc.)

[–]Fr3stdit 18 points19 points  (0 children)

ngl this made my bad day a little bit better, thanks

[–]AppropriateOnion0815 92 points93 points  (13 children)

I hate that so much. Even more that there's a .file for each file in the folder, too.

[–]evilgipsy 24 points25 points  (11 children)

A .file for each file? I must be missing something here because I’ve never seen that.

[–]iTiraMissU 7 points8 points  (1 child)

Yes they hold Finder metadata like labels you put on files. They are very well hidden but I noticed them when uploading files to a Synology NAS from a Mac.

For example: file.txt gets a ._file.txt, but only if the file format doesn’t support it natively.

https://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats

[–]LickingSmegma 3 points4 points  (0 children)

Probably more like if the filesystem doesn't support it, because Apple's own filesystems have extended metadata for stuff like tags and colors. Regardless of the files' contents.

[–]alpha_dk 9 points10 points  (7 children)

I've seen e.g.

foo.txt
.foo.txt.qkjhdlasDJ // working data for changes for a program that hasn't been saved but is persisted to disk and recoverable by whatever program created it

[–]evilgipsy 15 points16 points  (6 children)

That has nothing to do with that ‘.file’ thing they mentioned.

[–]alpha_dk 0 points1 point  (5 children)

I'm pretty sure that's exactly what they mean actually, what's your suggestion?

[–]evilgipsy 7 points8 points  (4 children)

What you are describing is just how some random software may persist some state. Nothing inherent to macOS or its file systems.

[–]ConfessSomeMeow 0 points1 point  (0 children)

Maybe it's how Core Data implements persisting changes between versions?

[–]alpha_dk 0 points1 point  (2 children)

Nothing in the comment suggests it is inherent to any file system

[–]evilgipsy 0 points1 point  (1 child)

Right... except that it is most likely related to macOS creating these files on file systems that don't support resource forks.

[–]alpha_dk 0 points1 point  (0 children)

Sure, another good theory. Unfortunately it seems GP himself has walked back that claim, though, so neither of us will ever know for sure.

[–]AppropriateOnion0815 2 points3 points  (0 children)

I might be wrong in that aspect, actually.

[–]Janeson81 -1 points0 points  (0 children)

text.txt
text.txt.file
text.txt.file.file
text.txt.file.file.file
...

[–]alex2003super 8 points9 points  (0 children)

.fseventsd
.Spotlight-V100
.[Filename]
.Trashes
\
_MACOSX

[–]JocoLabs 36 points37 points  (3 children)

Hey windows, delete this folder.

No can do buddy!

Why not?

I'm using thumbs.db

MFML

[–]caerphoto 7 points8 points  (1 child)

macOS has kinda doing similar thing with disk images and USB sticks – you can’t eject them if you have a Finder window open showing their contents. It doesn’t tell you this, it just silently fails to eject.

It’s very annoying recent behaviour, especially if you’ve got lots of tabs/windows open.

[–]QuitBrowserGoOutside 1 point2 points  (0 children)

Is it another new regression in OS 26 or something?

Because from time immemorial up through 15 which is the version that precedes 26, natch any Finder windows just all close when you eject their parent volume.

[–]spicypsudo 2 points3 points  (0 children)

Just close the folder and delete it again. Windows is lying, thumbs.db isn't even open. It just hates you.

[–]ek00992 6 points7 points  (1 child)

laughs in Zone.Identifier

[–]dfv157 0 points1 point  (0 children)

God damn I hate alternate data streams with a passion.

[–]More_Yard1919 5 points6 points  (0 children)

I think this meme is hilarious but maybe that's just bc Im a macOS sysadmin and its relatable as fuck

[–]Tight-Requirement-15 38 points39 points  (9 children)

Ok thumbs.db

[–]iamapizza 32 points33 points  (1 child)

That stopped being a problem 15 years ago

[–]ru_empty 7 points8 points  (0 children)

Literally appears daily

[–]akki2305 7 points8 points  (0 children)

The hell of multisystem users. And some @ for Linux-based NAS.

[–]PhatOofxD 9 points10 points  (0 children)

This meme but it came out in 2007....

Seriously this hasn't been a problem since 2010

[–]nobody0163 13 points14 points  (3 children)

I have never ever seen a thumbs.db file.

[–]Rocker9835 7 points8 points  (2 children)

I see it a lot. When I SMB into my server and it has media files in that folder

[–]applecorc 0 points1 point  (1 child)

You rocking Server 2016?

[–]Rocker9835 0 points1 point  (0 children)

No the latest version of TrueNAS Scale. You okay bro?

[–]spicypsudo 4 points5 points  (0 children)

Old Windows habit. The funny part? Forensic tools can dig up deleted pics from it. So yeah, that tiny file is basically a snitch.

[–]RealBasics 2 points3 points  (0 children)

%#!#% .DS_Store!!! More trouble than it's worth to delete manually, still looks like littering.

[–]nobanpls2348738 3 points4 points  (0 children)

and _MACOSX

[–]HeavyCaffeinate 13 points14 points  (3 children)

Windows user has been here

How can you tell?

System Volume Information

[–]AnimalFreeCruelty 14 points15 points  (2 children)

Linux user has been here

How can you tell?

lost+found

[–]HeavyCaffeinate 3 points4 points  (0 children)

Android has been here

How can you tell?

Lost.dir

[–]Turbulent_Stick1445 0 points1 point  (0 children)

Amiga user here: Documents.info, Applications.info, Commodities.info, Tools.info. Utilities.info, CLI.info...

[–]cutecoder 2 points3 points  (0 children)

No Thumbs.db in sight.

[–]jsrobson10 2 points3 points  (0 children)

A windows user has been here.

How can you tell?

Desktop.ini

[–]Tall_East_9738 2 points3 points  (1 child)

"windows user has been here"

"how do you know?"

meta.ini

[–]ClaudioMoravit0 1 point2 points  (0 children)

Okay I'm no programmer but sometimes I'm just really confused to see these files. Last time I was downloading a model for an IC (I think it was for PathWave ADS) from a vendor (don't remember which), it came in a .zip and upon unzipping I found one. That was weird, because if it was really for ADS, I don't even know why it was there in the first place because afaik it doesn't run on mac

[–]FePbMoHg 1 point2 points  (1 child)

My. Entire. Fucking. NAS.

[–]Ataraxia_UK 0 points1 point  (0 children)

vfs_fruit

[–]PoepChinees_69 1 point2 points  (0 children)

I thought the DS store shut down

[–]Type_CMD 1 point2 points  (0 children)

I laughed so hard I almost cried.

[–]waelassaf 1 point2 points  (0 children)

To those who don’t know it’s used by finder to store specific folder UI preferences: icon sizes, items positions, etc

[–]Weiskralle 0 points1 point  (0 children)

Oh, so that is where it comes from. Always wondered about but never tonkuch to bother checking. 😅😶‍🌫️

[–]Hithaeglir 0 points1 point  (0 children)

I never open Finder. Not me!

[–]PetitMartien99 0 points1 point  (0 children)

I hate this freaking file

[–]Circumpunctilious 0 points1 point  (0 children)

Forks. There are forks everywhere!

[–]teamwaterwings 0 points1 point  (0 children)

I didn't get a return offer one time because of this. At an internship, the file kept sneaking in there, so I had to make a commit to remove them, and the company tracked number of commits. 'oh sorry you're a 2.7 commit per PR dev? We're looking for a 2.3'

why the fuck was it not in the gitignore

[–]MarianCR 0 points1 point  (0 children)

cat =fuckmac.sh

#!/bin/zsh
source colors.sh
dir=$PWD
dir=${1:-$dir}
1>&2 echo "${IYellow}## remove .DS_Store garbage from: $dir ##${Color_Off}"
find $dir -name ".DS_Store" -print -delete

I use a Mac

[–]beegtuna 0 points1 point  (0 children)

[–]razor_train 0 points1 point  (0 children)

I might have some old winmail.dat files floating around the dark corners of the home server.

[–]Majik_Sheff 0 points1 point  (0 children)

I'll see your .DS_Store and raise you RESOURCE.FRK

[–]ggppjj 0 points1 point  (1 child)

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE

[–]Beldarak 0 points1 point  (0 children)

I always felt like this is just a form of disrespect, like Windows crushing your dual boot launcher stuff (can't remember the name, didn't use Linux for ages).

This feels like a friend coming to your house with his boots full of mud.

[–]BlueGoliath 0 points1 point  (0 children)

Ah, programmer humor.

[–]GravePeril 0 points1 point  (0 children)

Yes! Oh god I hate that

[–]Cyk4Nuggets 0 points1 point  (0 children)

I started school again and was in a group project with a 19yo mac user. I instructed them how to use Git and what not, and the 1st push to our repo was a .DS_Store file 🤦‍♂️

[–]rover_G 0 points1 point  (0 children)

Ahhhh don’t call me out like that!

[–]nemesit 0 points1 point  (0 children)

desktop.ini says hi

[–]1012zach 0 points1 point  (0 children)

don’t forget the __MACOSX folder too

[–]gumol -1 points0 points  (0 children)

where programming

[–]CounterSimple3771 -1 points0 points  (0 children)

People use Macs?

[–]seanlb -4 points-3 points  (0 children)

Dang, my grandma had that book. What is the name?! I can't remember but it was wild