如何将多个项目添加到Bitbucket中的单个存储库中?

时间:2015-09-28 03:42:50

标签: git github bitbucket

我正在尝试将多个项目添加到Bitbucket中的单个存储库中,但在我提交到原始主文件时提交后,它只添加了空文件夹。没有添加子文件夹和文件。我已按照以下步骤进行操作,

  1. 从主文件夹git init
  2. git remote add origin gitrepository姓名
  3. git add --all
  4. git commit -m "initial commit"
  5. git push -u origin master

1 个答案:

答案 0 :(得分:3)

如果这些项目文件夹本身是nested git repos,那就会发生。

在这种情况下,将忽略这些嵌套回购的内容:请参阅" How to commit a git repo into a git repo (not submodule)"。

您可以尝试" merge nested git repo into parent repo, retaining history"。

或者你可以将那些嵌套的repo声明为子模块 (如" Creating Git Submodules out of existing repository and reflecting parent changes to the child repository")