更改Git存储库目录位置。 [英] Change Git repository directory location.

查看:116
本文介绍了更改Git存储库目录位置。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Windows的Git / Github,如果我有一个具有以下目录的存储库: C:\dir1\dir2 ,我需要做些什么来移动回购文件到 C:\dir1 ?我可以明显地物理复制和粘贴文件,但是我需要在Git端做什么?



我在GitHub上有这个回购,我使用Git Bash和GitHub对于Windows。

解决方案

只需复制整个工作目录内容(包括隐藏的 .git 目录)。这会将整个工作目录移动到新目录,并且不会影响GitHub上的远程存储库。



如果您在Windows上使用GitHub,则可以使用GitHub如上所述的方法。但是,当您单击应用程序中的存储库时,将无法找到它。要解决这个问题,只需使用!单击蓝色圆圈,选择Find It,然后浏览到新目录。


With Git/Github for Windows, if I have a repository with this directory: C:\dir1\dir2, what do I need to do to move the repo files to C:\dir1? I can obviously physically copy and paste the files, but what do I need to do on the Git side?

I have this repo on GitHub and I use Git Bash and GitHub for Windows.

解决方案

Simply copy the entire working directory contents (including the hidden .git directory). This will move the entire working directory to the new directory and will not affect the remote repository on GitHub.

If you are using GitHub for Windows, you may move the repository using the method as above. However, when you click on the repository in the application it will be unable to find it. To resolve this simply click on the blue circle with the !, select Find It and then browse to the new directory.

这篇关于更改Git存储库目录位置。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆