Remove existing files from the repository:
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
Add this line:
.DS_Store
to the file .gitignore
, which can be found at the top level of your repository (or create the file if it isn’t there already). You can do this easily with this command in the top directory:
echo .DS_Store >> .gitignore
Then commit the file to the repo:
git add .gitignore git commit -m '.DS_Store banished!'
Related Posts:
- Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
- How do I update the password for Git?
- How can I display the current branch and folder path in terminal?
- Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
- Enable OpenMP support in clang in Mac OS X (sierra & Mojave)
- How can I run python in terminal on a mac?
- Enable OpenMP support in clang in Mac OS X (sierra & Mojave)
- No “Proceed Anyway” option on NET::ERR_CERT_INVALID in Chrome on MacOS
- Ignoring directories in Git repositories on Windows
- Xcode is not currently available from the Software Update server
- How to view / open a calculator in mac OS X?
- Gitignore not working
- Xcode is not currently available from the Software Update server
- How to uninstall Python 2.7 on a Mac OS X 10.6.4?
- Updating Python on Mac
- How do I upgrade to Python 3.6 with conda?
- You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory
- pip or pip3 to install packages for Python 3?
- You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user)
- How to change default Python version?
- SocketException: Address already in use MONGODB
- Failed to attach the USB device SEGGER J-Link [0100] to the virtual machine WINDOWS 7
- You don’t have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user)
- ImportError: No module named sklearn (Python)
- What’s a good hex editor/viewer for the Mac?
- Where to find Application Loader app in Mac?
- How to change default Python version?
- Brew install docker does not include docker engine?
- What version of Python is on my Mac?
- How can I make Git “forget” about a file that was tracked, but is now in .gitignore?
- brew install mysql on macOS
- Mongod complains that there is no /data/db folder
- How can I open the Atom editor from the command line in OS X?
- What are the differences between .gitignore and .gitkeep?
- How to install wget in macOS?
- Maven Install on Mac OS X
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- dyld: Library not loaded … Reason: Image not found
- How to install Java 8 on Mac
- editing PATH variable on mac
- Find (and kill) process locking port 3000 on Mac
- OS X Framework Library not loaded: ‘Image not found’
- Upgrade Node.js to the latest version on Mac OS
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- Vim Can’t Save File (E212)
- Change default title in mac terminal window
- Installing cgdb on a mac os x
- How can I install a previous version of Python 3 in macOS using homebrew?
- “code .” Not working in Command Line for Visual Studio Code on OSX/Mac
- mvn command not found in OSX Mavrerick
- Shared folder between MacOSX and Windows on Virtual Box
- VirtualBox: mount.vboxsf: mounting failed with the error: No such device
- Installing GCC on macOS Catalina
- Open an .html file with default browser using Bash on Mac
- git: How to ignore all present untracked files?
- gdb fails with “Unable to find Mach task port for process-id” error
- OS X 10.9.2: checking whether the C compiler works… no
- How to use vim in the terminal?
- -bash: export: `=’: not a valid identifier
- How to use vim in the terminal?
- OS X cp command in Terminal – No such file or directory
- What to gitignore from the .idea folder?git intellij-idea gitignore webstorm
- psql: command not found Mac
- Can’t connect to MySQL server on ‘127.0.0.1’ (61) on Mac
- psql: FATAL: role “postgres” does not exist
- Python: source code string cannot contain null bytes
- git add only modified changes and ignore untracked files
- sed command with -i option failing on Mac, but works on Linux
- Reset MySQL root password using ALTER USER statement after install on Mac
- Mac install and open mysql using terminal
- Run script on mac prompt “Permission denied”
- Why does cURL return error “(23) Failed writing body”?
- Finding text inside a folder using terminal
- Command not found go — on Mac after installing Go
- What is the difference between MacVim and regular Vim?
- gdb debugging in Terminal OS X (10.8.5) with zsh
- Updating php version on mac
- Kill a python process
- Why is .gitignore not ignoring my files?
- Reading syslog output on a Mac
- Unmount the directory which is mounted by sshfs in Mac
- Failed to launch macOS app built in Xcode
- Testing web application on Mac/Safari when I don’t own a Mac
- What is the best/safest way to reinstall Homebrew?
- Sourcetree adding files in global .gitignore, not in repository .gitignore
- How to edit gitignore file
- How to completely uninstall Android Studio on Mac?
- SQL Client for Mac OS X that works with MS SQL Server
- How do you stop MySQL on a Mac OS install?
- How to navigate to to different directories in the terminal (mac)?
- Is there an equivalent of lsusb for OS X
- Where to find extensions installed folder for Google Chrome on Mac?
- hat’s a clean way to stop mongod on Mac OS X?
- What is .gitignore exactly?
- How to restart a node.js server
- Mongod: Command Not Found (OS X)
- Open Sublime Text from Terminal in macOS
- how to update npm on macOS
- Unable to access MySQL after it automatically generated a temporary password
- No module named ipykernel_launcher