Skip to content

Instantly share code, notes, and snippets.

@betty-godier
Last active May 20, 2021 13:07
Show Gist options
  • Save betty-godier/136b486b71dc3f75cdb86a0e88901f6b to your computer and use it in GitHub Desktop.
Save betty-godier/136b486b71dc3f75cdb86a0e88901f6b to your computer and use it in GitHub Desktop.
suppress ds store

Author: Betty Godier | Twitter: @BettyGodier | Email: [email protected]

#Useful solution to Fix Git Problems with .DS_Store

1️⃣ Delete the existing files from the repository:

find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch

2️⃣ Add row

.DS_Store

to .gitignore file, which can be found at the top level of your repository (or created if it is not already there).

You can do it easily with this command in the top directory

echo .DS_Store >> .gitignore

3️⃣ then commit the .gitgnore file to the repository :

git add .gitignore git commit -m '.DS_Store banished!'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment