Question

I'm using github as a repo for a little project, but I'd also like to use some code written by another github user.

Is it possible to setup a /library/libraryname folder inside my project which maintains it's links back to the other users repo as well as being part of my projects commits?

For example: If the other user updates their code later on, I'd like to be able to easily fetch their changes while still keeping it in the same repo as my main project.

Was it helpful?

Solution

If you want, you can use git subtree instead of git submodule. This is a little bit more convenient to use, and doesn't require people who checkout from your repository to know anything about submodules or subtrees. It also makes it easier to maintain your own patches to the subproject until you're ready to submit them upstream.

OTHER TIPS

I think you're probably looking for the git submodule command. Also have a look at the Git Submodule Tutorial.

-- edit

Removed my claim that it's 'probably not possible'. Rest of my argument is still valid.

But anyway, generally, you don't want to get updates so fast like that. You'd prefer to have a 'stable' version of his library, and update it only when another 'stable' version is released (as tested by you; not neccessarily one considered 'stable' by him).

So even if you could (but in SVN, which I use, you can't, but I don't know about git specifically) you wouldn't want to.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top