[英]How to change git directory
我在一个子文件夹中有一个正常的git存储库,现在我想在其中包含基础文件夹。
例如
我的回购在:
/var/dir/working/
现在我也想加入回购中
/var/dir/
如何以最简单的方式实现?
我不确定最简单的方法是否是将.git
文件夹更改为应有的位置。
cd /var/dir/working/
mv .git ../.git # move the .git folder to the parent directory
cd .. # go to parent directory
git status # then you can see a lot of delete and untracked
git add . # output nothing
git status # after add all, you can see those delete and untracked are converted
# to renaming, and some untracked from "parent directory"
git commit -m "Include parent directory" # you may see a lot of renaming,
# and new file from parent dir, that's it
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.