我正在尝试将多个项目添加到 Bitbucket 中的单个存储库中,但是在我推送到源主机时提交后,它只是添加了空文件夹。未添加任何子文件夹和文件。我已按照以下步骤操作,
- 从主文件夹,
git init
git remote add origin gitrepository
名称git add --all
git commit -m "初始提交"
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/