git - 将 git hub 存储库更改为主文件夹(iso 子文件夹)
问题描述
我对 git hub 还很陌生,我正在与两个人一起在一个存储库上工作。目前我在以下位置有一个(本地)存储库:
C:\Users\Name\main_folder\sub_folder_9\
现在,main_folder
里面有很多子文件夹。我们现在只共享/推送 中的信息sub_folder_9
,但我们想向上“移动”目录。所以我们想在 中建立一个存储库main_folder
,这样每当我们使用 Git Bash 时,所有子文件夹都会被推送和拉取。而且我们希望使用我们目前拥有的相同存储库(在 github.com 站点上),因此我们不必设置新的存储库。
我怎样才能做到这一点?
我知道我可能使用了错误的措辞,对此我很抱歉,但我希望我的问题仍然有意义。
解决方案
正如您在评论中所说:是的,您可以将.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
然后推。
推荐阅读
- c# - 通过字符串的某个位置获取ascii的char
- sql - 如何从 Postgres 中的时间戳列获取具有微秒精度的 Epoch?
- android - 构建后字符在strings.xml中变成问号
- angular - 从 http GET 获得第一个结果后立即显示项目
- mysql - sql count(*) 查询另一个执行多个结果的查询的结果
- sql - 如何在SQL中获取英文字母的第n个字母
- php - Sonarqube 与 Gitlab 的集成
- linux - 输出重定向应该重新创建目标文件
- node.js - 从NodeJS将数组插入redis
- google-apps-script - 通过谷歌应用脚本将谷歌云搜索集成到 gmail 插件中