Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
可以移动git存储库的父目录吗?_Git_Github - Fatal编程技术网

可以移动git存储库的父目录吗?

可以移动git存储库的父目录吗?,git,github,Git,Github,假设在我的本地机器中有一个git存储库,它与github.com中的远程git存储库同步 我的机器中的本地git存储库是/home/t/work/project1/.git 如果我将/home/t/work/project1移动到一个不在/home/t/work/project1下的目录下,例如/home/t/work/projects,它是否会改变与git相关的任何内容 谢谢。您正在移动整个源代码树。Git元数据位于文件夹中,通常是根文件夹中名为.Git的隐藏文件夹。因为你在移动所有的东西,相

假设在我的本地机器中有一个git存储库,它与github.com中的远程git存储库同步

我的机器中的本地git存储库是
/home/t/work/project1/.git

如果我将
/home/t/work/project1
移动到一个不在
/home/t/work/project1
下的目录下,例如
/home/t/work/projects
,它是否会改变与git相关的任何内容


谢谢。

您正在移动整个源代码树。Git元数据位于文件夹中,通常是根文件夹中名为.Git的隐藏文件夹。因为你在移动所有的东西,相对来说没有什么变化。因此,您可以很好地移动父目录。与移动子目录不同,这种移动不会改变任何内容。

是的,没有问题。git信息存储在
.git
文件夹(隐藏)中,因此可以移动整个文件夹