Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push a git submodule to AWS Elastic Beanstalk?

I have a repo named ld with a submodule named ldapp, which is a Django project. I want to push the Django project ldapp to elastic beanstalk, but I get the warning following warning when running eb init:

Warning: Your directory has not been initialized as a Git repository. To create a local Git repository, run "git init" and then re-run the "eb init" command.

If I continue on and run eb push I get:

git: 'aws.push' is not a git command. See 'git --help'. Cannot run aws.push for local repository HEAD:

The way git structures submodules is it actually has the .git of the submodule be a file, not a directory. The following is the contents of the file ldapp/.git:

gitdir: ../.git/modules/ldapp

This file tells git to retrieve ldapp's versions from ld's .git directory. Since the .git versioning of ldapp is not present within ldapp itself (but rather within ld's .git), running eb init and eb push fail. How do I fix this?

like image 492
Gobi Dasu Avatar asked Jan 01 '26 04:01

Gobi Dasu


1 Answers

I don't think you can. I had to git clone the submodule to get back a standalone Git repository.

like image 55
ma11hew28 Avatar answered Jan 03 '26 23:01

ma11hew28



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!