Should you include libraries and code-unrelated files in your git project and upload them to Github?

softwareengineering.stackexchange https://softwareengineering.stackexchange.com/questions/340223

Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
scroll top