初始推送到 GitHub 缺少子目录
Initial push to GitHub Missing Sub Directory
我从我们的代码库向 GitHub 进行了初始推送,但是由于某种原因,两个网站子目录之一没有被推送。
我们在两个子目录中都有 .git
个文件,但在创建这个新的组合存储库之前删除了它们。
我们已尝试将单个文件添加到子目录,但 SourceTree 未发现更改。
您将如何添加这些子文件夹?
We had .git files in both sub directories but removed them prior to making this new combined repository.
这还不够:您需要删除(取消跟踪)gitlink (folder name of the two subdirectories, viewed as a special entry in the index of the parent repo)
git rm --cached subfolder1
git rm --cached subfolder2
git commit -m "remove gitlinks"
然后就可以添加并提交了(前提是嵌套的.git/文件夹确实没有了)
git add .
git commit -m "add two subfolders"
git push
我从我们的代码库向 GitHub 进行了初始推送,但是由于某种原因,两个网站子目录之一没有被推送。
我们在两个子目录中都有 .git
个文件,但在创建这个新的组合存储库之前删除了它们。
我们已尝试将单个文件添加到子目录,但 SourceTree 未发现更改。
您将如何添加这些子文件夹?
We had .git files in both sub directories but removed them prior to making this new combined repository.
这还不够:您需要删除(取消跟踪)gitlink (folder name of the two subdirectories, viewed as a special entry in the index of the parent repo)
git rm --cached subfolder1
git rm --cached subfolder2
git commit -m "remove gitlinks"
然后就可以添加并提交了(前提是嵌套的.git/文件夹确实没有了)
git add .
git commit -m "add two subfolders"
git push