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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With