I have a git repository on a mac, when I use git status
in terminal it says
On branch master
nothing to commit, working directory clean
when I try to pull changes from repository git pull repositoryName master
error: The following untracked working tree files would be overwritten by merge:
.DS_Store
Please move or remove them before you can merge.
so I tried to remove it with git rm .DS_Store
but it says
fatal: pathspec '.DS_Store' did not match any files
I then tried to remove the cached file and add it again with git rm --cached . -r
and git add .
with a .gitignore directive that would ignore .DS_Store but the problem still persists.
I tried lots of commands that I saw on different posts without success. Any help would be appreciated.
.DS_Store
is a Mac related file that is created every time you touch some directory (if I'm not mistaken, it is used for indexing).
So, first you don't have it. Then you try to bring some files/folders into your directory (and thus it gets created - breaking your pull command).
In your repo directory create a file called .gitignore and inside it have a single line (so far) .DS_Store. This should fix your problem.