5

When you are working with an external library in git, should you add it to Git or should it be in gitignore? If you put it in gitignore, you run into the problem that if someone (or you yourself on another PC) wants to work on your code, they will first have to download and link the library. If you do include it, the graph of code activity will show 22k lines of code being changed on the initial commit and then only 100 on each following commit (at least that happened to me).

So is one of these solutions right or is there another one that I am missing?

PS: The same also applies to Makefiles and similar files.

asked Jan 15, 2017 at 16:42
8
  • I don't understand what you're asking. Maybe if you provided a more specific example of the problem you're trying to solve. Commented Jan 15, 2017 at 16:46
  • If I am using external libraries, in this case SFML, should I upload the whole SFML folder to my GitHub or should it be in gitignore, so that it doesn't show up, since it isn't my code and technically doesn't have much to do with my project (especially since there is a GitHub repository that contains exactly those files) Commented Jan 15, 2017 at 16:48
  • Don't they have package managers for this sort of thing? Commented Jan 15, 2017 at 16:48
  • 3
    And if you don't use package managers but want source files included you might want to use git submodules. Commented Jan 15, 2017 at 16:54
  • 1
    P.P.S. This doesn't apply to makefiles. You definitely should include your makefile in your repository so people can clone the project and immediately be able to build it. Commented Jan 15, 2017 at 17:50

1 Answer 1

6

As a rule, you should list somewhere the OS, compiler version, tools that I need to run your code, and then I should be able to clone your repository, follow your build instructions, and be able to run the code.

Can I do that without your makefile? If yes, leave the makefile out. If no, add the makefile. Having your documentation would be nice, too. Oh, build instructions that work would be nice.

answered Jan 15, 2017 at 21:16

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.