2

Should you ignore .obj, .mtl, ect... files in order to be able to track lines added and removed from places like GitHub?

When I commit with .obj files and pushed it added 13,000 lines of code to my stats. I feel like that is so unfair. Is there a way to upload model and keep lines off? If not how do most people and teams share these models?

I checked github's documentation, but couldn't find anything related to the subject.

Also, when I added to .gitignore it did not ignore the .obj files. So wierd.

I tried *.obj and obj as lines to ignore. Neither worked.

# Ignore .obj files #
*.obj
*.mtl

Still get this...

You can view image here:

Community
  • 1
  • 1
user290831
  • 25
  • 5
  • What do you mean by "unfair"? I'm not sure I understand your problem. – jcoder Jan 27 '14 at 12:55
  • I think it is unfair to be the one to upload a model and then have an extra 13,000 lines of code committed since that is what is briefly looked at to judge who contributed most to the project from the outside world. - Eg. Coder_1 has 15,000 lines of code submitted and Coder_2 has 3,000 lines. If Coder_2 uploads some .obj files for a total of 5 objects... each with 13,000 lines of "code" then Coder_2 has a total of 68,000 lines of code when only really they should have 3,000 lines of code. – user290831 Jan 27 '14 at 13:24
  • AH right I see. Not a technical problem then. An inappropriate measure of productivity :) I see you have an answer that should help – jcoder Jan 27 '14 at 14:55

1 Answers1

2

Git can ignore those files if you remove them first from the index (not from your disk).

git rm --cache *.obj

You can recursively remove the content of a folder too, like build/: see

Anything that can easily be regenerated shouldn't be included in the repo.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Will test that later today and get back to you. I really like that last part... "Anything that... repo." Now I know what to include and what not to include. – user290831 Jan 27 '14 at 13:29
  • Ok, the rm --cache helps so much. That is why it wouldn't remove! Problem solved! Thanks! – user290831 Jan 27 '14 at 13:42