Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to release in Git with submodules

Im starting to work with git submodules and Im a bit confused. Basically on my project I needed a modified version of hybridauth library. So I forked hybridauth, did my changes and added it as a submodule of my repo.

Now when I try to do a release of my repo or simple download a zip copy of my master branch (I use bitbucket and sourcetree ) I get the project with an empty hybridauth folder on it.

I think I have everything configured properly. When I do changes on the submodule then I also commit then in the main repo.

But I can't download the whole project in one file to redistribute it.

How can I do it? Thanks!

like image 252
chifliiiii Avatar asked Jan 20 '26 14:01

chifliiiii


1 Answers

You could build that one archive file by:

  • cloning your repo
  • updating your submodules (git submodule update --init)
  • taring the resulting work tree (or use the git-archive-all.sh script I mentioned in "How can I use git-archive to include submodules from a bare repository")

However, that arcive is local only (not visible on BitBucket). GitHub offers a way to associate an artifact (like an archive file) to a "release".

For BitBucket, you could associate your project with a Continuous Integration (CI) service, and repeat the steps above as part of a build/packaging job, and distribute the resulting deliverable (the zipped archive) through that CI service.

like image 74
VonC Avatar answered Jan 22 '26 03:01

VonC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!