2

I do not understand one file which is not on git repository & not on local repository (not even local & physical folder) but while I am going to commiting or push it seems in files hierarachical? By unchecking this file I am able push & pull code properly but I am curious to find what is the exact issue.

enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Your operating system (OSX) creates this file. See [Wiki](https://en.wikipedia.org/wiki/.DS_Store). I recommend to add this kind of file to `.gitignore`. – shallowThought Apr 06 '17 at 08:08

3 Answers3

2

.DS_Store is a hidden file, which is created by MacOS to store the information about the containing folder. You should add this file to your .gitignore, so the git will never display it in your untracked/modified list.

According to wikipedia:

In the Apple macOS operating system, .DS_Store is a file that stores custom attributes of its containing folder, such as the position of icons or the choice of a background image. The name is an abbreviation of Desktop Services Store, reflecting its purpose. It is created and maintained by the Finder application in every folder

Midhun MP
  • 103,496
  • 31
  • 153
  • 200
  • Hello friend **.DS_Store** is already on git repository & contains in each folder what can i do else to remove this file from hierarchical –  Apr 06 '17 at 08:51
  • @yummy: Go ahead and delete them all using `find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch` and add the .gitignore and add it to the repo. Read more about that here : http://stackoverflow.com/a/107921/1104384 – Midhun MP Apr 06 '17 at 08:53
0

.DS_Store is MacOS system file that will appear in each directory for default HFS+ filesystem. Your Finder most likely is not dispaying hidden files (with dot prefix). You can setup .gitignore not to include .DS_Store, details here

Community
  • 1
  • 1
Kamil.S
  • 5,205
  • 2
  • 22
  • 51
0

It seems you have changed filename EditOrNewAddressVuewController.m to EditOrNewAddressVuewController~.mthat is saved this info in .DS_Store & you pushed code to remote thereafter this because that .DS_Store info there is untracked file appears on you Git working tree hierarchy,

If you don't like this untracked file,delete .DS_Store add .gitignore file. Helpful link1, link2,link3

Even if, there is one silly way for avoiding to watch this,Clone project in another folder ;)

Community
  • 1
  • 1
Mukesh Lokare
  • 2,159
  • 26
  • 38