0

I asked a similar question the other day, but i think this is different enough to make it worth another question

I am currently using BitBucket and Source tree with my project, here is my git ignore.

EDIT* NEW GITIGNORE. enter image description here

EDIT* File Structure. enter image description here

My issue is that when I switch PC and pull as soon as i open the project, without doing anything it gives me about 1000 meta files to commit and a project settings file and a c sharp assembly file, surely this cant be right. Thoughts?

I do have force text enabled and i do have meta files visible.

Thanks Everyone.

EDIT

Here is a snapshot of the meta files.

enter image description here

bSky
  • 187
  • 2
  • 12
  • I suggest adding these files to your .gitignore file. Anything that is generated by your build system should be ignored and not added to version control. – Code-Apprentice Feb 17 '16 at 21:59
  • What do the paths to these 1000 meta files look like? For the record, the meta files should not be ignored and should be on your repo online. – andeart Feb 17 '16 at 21:59
  • @andeart Added a snapshot of the files. – bSky Feb 18 '16 at 20:56
  • It looks like you have a folder called 'Not a Nightmare' inside your project's root, which isn't being ignored. – andeart Feb 18 '16 at 20:59
  • @andeart that is the unity project folder. – bSky Feb 18 '16 at 21:00
  • Well, if your gitignore has `/Library/`, it is not going to ignore `Not a Nightmare/Library/`. I suggest removing the leading slash (but that would look for Library anywhere, which might act up), or restructuring your project so that your Unity project is the root. – andeart Feb 18 '16 at 21:06

2 Answers2

2

My guess is that these files are indeed in your repository (perhaps they were added before you updated your .gitignore), that they contain CRLF line endings, and that on your new PC git core.autocrlf returns true. If that is indeed the case, then git plans to convert all those CRLFs into LFs, and thus considers your local copy "different" than what is in the repo. Try setting core.autocrlf to false to stop git from doing that. If that fixes it, a good idea would be to add the following to your .gitattributes file:

* -text

That will disable such end of line processing no matter what machine the repo is on in the future.

David Deutsch
  • 17,443
  • 4
  • 47
  • 54
0

As I posted in the comment above: If your gitignore has /Library/, it is not going to ignore Not a Nightmare/Library/ and its contained files. You could try removing the leading slash, but I suggest restructuring your project so that your Unity project is the root.

Example:

enter image description here

I hope that helps!

andeart
  • 935
  • 6
  • 19
  • Edited original post to show a new git ignore i have tried and the file structure which it was already like with the old git ignore. – bSky Feb 18 '16 at 22:30