Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: The following untracked working tree files would be overwritten by merge: .DS_Store

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.

like image 514
D4rWiNS Avatar asked Jan 24 '17 11:01

D4rWiNS


People also ask

What are untracked files in git?

Untracked files are files that have been created within your repo's working directory but have not yet been added to the repository's tracking index using the git add command.


1 Answers

rm .DS_Store

I ran the above command on the repo folder. and finally could pull from git. I suggest you add .DS_Store in your .gitignore file.

like image 167
Ares Avatar answered Oct 18 '22 03:10

Ares