我是git hub的新手,我正在和两个人一起开发一个存储库。目前,我在以下位置有一个(本地)存储库:
C:\Users\Name\main_folder\sub_folder_9\现在,在main_folder中有很多sub_folders。我们现在只共享/推送sub_folder_9中的信息,但我们想“上移”目录。所以我们想在main_folder中建立一个仓库,这样当我们使用Git Bash时,所有的sub_folders都会被推送和拉取。并且我们希望使用当前拥有的相同存储库(在github.com站点上),因此我们不必设置新的存储库。
我如何才能做到这一点?
我知道我可能使用了错误的文字,我对此感到抱歉,但我希望我的问题仍然有意义。
发布于 2020-06-15 00:03:36
正如您在评论中所说:是的,您可以将.git文件夹上移一级,然后推送。
更准确地说:
# move the .git folder one level up :
mv .git ../
cd ../
# if you want, you can create a separate commit which clearly moves only sub_folder_9 :
git add sub_folder_9
git commit
# add the remainder of your main_repo folder :
git add *
git commit然后用力推。
https://stackoverflow.com/questions/62371589
复制相似问题