Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+12 votes

My git status keeps showing .DS_Store as an untracked file even though .DS_Store is in gitignore. As a result I am having trouble with merging. Any suggestions? Please and thank you!

asked in CSC305 Fall 2023 by (1 point)

3 Answers

+4 votes

Can you elaborate on what you are trying to ignore and how?

answered by (1 point)
+4 votes

Once a file has been committed your git repository, it won't get ignored, even if you change the .gitignore.

To get it to start ignoring, you need to first remove it from the git repository.

cd to the folder that contains the problematic .DS_Store file, and then try:

 git rm --cached .DS_Store

or, if that doesn't work, maybe

  git rm .DS_Store
answered by (1.9k points)
+1 vote

Even though you are adding it to your git ignore, it seems like git is ignoring your "-DS.store" files. Try using git rm --cached. DS.Store and commit your changes. It may fix it.

answered by (1 point)
...