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

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

问题描述

对于 Windows 的 Git/Github,如果我有一个包含此目录的存储库:C:dir1dir2,我需要做什么才能将 repo 文件移动到 C:dir1?我显然可以物理复制和粘贴文件,但我需要在 Git 端做什么?

With Git/Github for Windows, if I have a repository with this directory: C:dir1dir2, 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?

我在 GitHub 上有这个 repo,我使用 Git Bash 和 GitHub for Windows.

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

推荐答案

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

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.

如果您使用 GitHub for Windows,您可以使用上述方法移动存储库.但是,当您单击应用程序中的存储库时,它将无法找到它.要解决此问题,只需单击带有 ! 的蓝色圆圈,选择查找",然后浏览到新目录.

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天全站免登陆