For my github project, I want to use several 3rd party libraries that are also on github (such as: GitHub - lz4/lz4: Extremely Fast Compression algorithm). I want to know the best way to pull 3rd party code into my project. Looking at other projects that use lz4, I see several approaches:
- Some people copy the entire contents of lz4 (or other 3rd party code) and commit into a subdirectory of their project.
- Others create a fork of lz4.
- Stackoverflow answers have suggested using git submodule add.
- I assume some people just git clone lz4 when needed, but don’t commit lz4 into their own git repo.
- Are there other approaches I’m missing?
What are the pros and cons of those approaches and why do people choose different approaches? In most cases, I do not want to change the 3rd party library at all, but in a few cases, I might want to make minor changes.