Skip to main content

Working from the bases that .DS_Store has not been added to your git repository, then you can add it to your .gitignore file.

touch .gitignore

In the .gitignore file add the following

# Hide the DS_Store files
**/.DS_Store

However, if it's already there, then in Terminal you will need to write:

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

Finally commit to repo

git commit -m "Remove .DS_Store"
git push origin main

 

Related articles

Andrew Fletcher17 Feb 2024
Update a git feature branch to the latest branch (master)
In our projects, team members frequently generate new Git branches linked to the same Jira number, resulting in cluttered and disorganised structures that can pose challenges for both current and future developers. For instance:Jira: ABC-123Ticket work: Reformat headersOver time, these branches...
Andrew Fletcher12 Oct 2023
What the following git commands do...
git reset, git revert, and git cherry-pick are three Git commands used for different purposes related to managing your version control history. Here's a brief overview of each command:git reset git revert git cherry-pick Snapshotgit revertis to roll back to a previous version of the repo...
Andrew Fletcher29 Sep 2023
How to install PHP 8.1 on Ubuntu 20.04
Update Ubuntu 20.04To begin update the server using the commandsudo apt update && sudo apt upgrade -yFor more details about this process see How To Update All Packages Linux. PHP versionCheck the current PHP version usingphp -vThe response I had wasPHP 7.4.3 (cli) (built: Nov 2...