I'm developing an application that uses git, so I need to test its integration with git. Inside my git repository, I need to have another repository (my_git_repo/tests/another_repo). How can I commit it without git submodules? (I don't want to have another remote repository (in github/bitbucket, etc) for just one file)
Any ideas?
Submodules don't necessarily need to be cloned separately; you can publish a project and its submodules in a single repo. Just have a branch dedicated to the submodule contents in your main repo, then after cloning the main repo
git clone -sbthe submodule directly from there.Setup in new clone:
and
subwill have the most recent content.git rev-parse :subwill show you what's committed forsub-- i.e. what should be checked out there -- when you don't just want the current branch tip.You could hook up the
git submodulecommand here, with a.gitmodulesfile and this and that, but it hardly seems worth it.