2

I started using github newly. I'm having trouble to load my .obj file to my repository. I found a gitignore file good to use with unity projects and I'm using it.

Temp/
Obj/
UnityGenerated/
Library/

*.svd
*.userprefs
*.csproj
*.pidb
*.sln
*.suo
*.user
*.unityproj
*.booproj

which one of this causes this? or is there any other reason?

Semih Yagcioglu
  • 4,011
  • 1
  • 26
  • 43
Cenkisabi
  • 1,066
  • 8
  • 25
  • 1
    You don't have a global gitignore which has additional ignored content? – Bart Sep 02 '15 at 13:29
  • no just this gitignore I have – Cenkisabi Sep 02 '15 at 13:33
  • And where are your .obj files located? And just to confirm, we're talking meshes, right? Are you using a Git client? – Bart Sep 02 '15 at 13:33
  • .obj file is in Assets/Resources folder and yes meshes. and Im using GitHub Desktop – Cenkisabi Sep 02 '15 at 13:36
  • 1
    I don't know if GitHub Desktop installs anything like it, but clients such as SourceTree come with a default gitignore as well. Normally *.obj files are the result of code compilation and not meshes, so they are usually set up to be ignored. I would look into that to see if something like that is hiding your .obj files. I would primarily look in your home directory for culprits. – Bart Sep 02 '15 at 13:52
  • Even when I deleted my own gitignore file, all ignored files came up but it still didn't appear. So it should be something like that you said. – Cenkisabi Sep 02 '15 at 14:04
  • Thank you Bart! I have looked and found a global gitignore file. This is the problem. Thank you so much – Cenkisabi Sep 02 '15 at 14:36
  • No worries. Glad it's solved. Perhaps make your solution an answer so everyone can see what you did to resolve your problem. – Bart Sep 02 '15 at 14:41
  • So can you write your usefull comment as answer? and I will accept it. – Cenkisabi Sep 02 '15 at 14:43

3 Answers3

1

Your own gitignore is not the culprit here. So something else is likely causing your .obj files to be ignored.

The reason is that .obj files in your context are meshes, but they are also a file format for files which are the result of code compilation.

Several Git clients I know of are trying to help you out by providing you with a global ignore file for Git. So the likely culprit is that such a file (probably located in your home directory) contains an entry causing it to ignore .obj file. Locate the ignore file and adapt it as necessary.

Bart
  • 19,692
  • 7
  • 68
  • 77
1

The problem is that your repository provider such as "Sourcetree" creates an additional .gitignore file, it's named gitignore_global.txt.

In Windows it's installed by default at C/Users/Documents/gitignore_global.txt. Just open the file and erase the line where it says *.obj.

0

Obj/ will block the whole object directory. I'm guessing it's under there. The *.something ones will block by file ending, which doesn't seem to be the problem.

Astrogat
  • 1,617
  • 12
  • 24
  • .obj is also a mesh file format. in the context of Unity3D I would expect it to be in the Assets folder (or sub-folder of it). If that is the case, your otherwise reasonable answer wouldn't apply. So perhaps the OP can confirm? – Bart Sep 02 '15 at 13:31
  • my .obj file is in the Assets/Resources folder, so I don't think Obj/ will block it – Cenkisabi Sep 02 '15 at 13:34