简体   繁体   English

如何将git子模块推送到AWS Elastic Beanstalk?

[英]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. 我有一个名为ld的repo,它有一个名为ldapp的子模块,它是一个Django项目。 I want to push the Django project ldapp to elastic beanstalk, but I get the warning following warning when running eb init : 我想将Django项目ldapp推送到弹性beanstalk,但是在运行eb init时我收到警告:

Warning: Your directory has not been initialized as a Git repository. 警告:您的目录尚未初始化为Git存储库。 To create a local Git repository, run "git init" and then re-run the "eb init" command. 要创建本地Git存储库,请运行“git init”,然后重新运行“eb init”命令。

If I continue on and run eb push I get: 如果我继续并继续运行eb push我得到:

git: 'aws.push' is not a git command. git:'aws.push'不是git命令。 See 'git --help'. 见'git --help'。 Cannot run aws.push for local repository HEAD: 无法为本地存储库HEAD运行aws.push:

The way git structures submodules is it actually has the .git of the submodule be a file , not a directory . git结构子模块的方式实际上是子模块的.git文件 ,而不是目录 The following is the contents of the file ldapp/.git: 以下是文件 ldapp / .git的内容:

gitdir: ../.git/modules/ldapp

This file tells git to retrieve ldapp's versions from ld's .git directory . 该文件告诉git从ld的.git 目录中检索ldapp的版本。 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. 由于ldapp的.git版本控制不存在于ldapp本身(而是在ld的.git中 ),因此运行eb initeb push会失败。 How do I fix this? 我该如何解决?

I don't think you can. 我认为你不能。 I had to git clone the submodule to get back a standalone Git repository. 我不得不git clone子模块来获取一个独立的Git存储库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM