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

标签 git github bitbucket

我正在尝试将多个项目添加到 Bitbucket 中的单个存储库中,但是在我推送到源主机时提交后,它只是添加了空文件夹。未添加任何子文件夹和文件。我已按照以下步骤操作,

  1. 从主文件夹,git init
  2. git remote add origin gitrepository 名称
  3. git add --all
  4. git commit -m "初始提交"
  5. git push -u origin master

最佳答案

如果这些项目文件夹本身就是 nested git repos 就会发生这种情况.

在那种情况下,那些嵌套 repo 的内容将被忽略:参见“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”)

关于git - 如何将多个项目添加到 Bitbucket 中的单个存储库中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32815387/

相关文章:

mercurial - scp 一个 mercurial 存储库

java - 通过 GIT 将 bitbucket 项目导入 Eclipse 失败并出现错误

linux - 在 Debian 服务器上通过 ssh 连接到 Git 用户时没有(自定义)答案

git - 无法从 github 提取更改 - 权限被拒绝(公钥)。致命: Could not read from remote repository

git插入子目录的历史变化

mercurial - 使用 Mercurial 插入多个头

git - 恢复到 Bitbucket 中的旧提交

git - fork 后在 devOps 上设置 git 的默认存储库

Git:压缩不是最近提交的连续提交,并且不从根开始

GitHub git 远程添加源 git@github.com :username/ProjectName a one time process?