将git hub存储库更改为主文件夹(即o子文件夹)

时间:2020-06-14 11:01:17

标签: git github

我对git hub还是陌生的,并且我正在与两个人一起在存储库上工作。目前,我在以下位置有一个(本地)存储库:

C:\Users\Name\main_folder\sub_folder_9\

现在,main_folder中有很多子文件夹。现在,我们仅共享/推送sub_folder_9中的信息,但是我们想“向上移动”目录。因此,我们想在main_folder中建立一个存储库,以便每当我们使用Git Bash时都推入和拉出所有sub_folders。而且我们想使用当前拥有的相同存储库(在github.com站点上),因此我们不必建立新的存储库。

我该如何实现?

我知道我可能使用了错误的语言,对此感到抱歉,但我希望我的问题仍然有意义。

1 个答案:

答案 0 :(得分:0)

正如您在评论中所说:是的,您可以将.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

然后按下。

相关问题