如何将本地git回购从一个硬盘移动到另一个硬盘? [英] How to move local git repo from one hdd to another hdd?

查看:235
本文介绍了如何将本地git回购从一个硬盘移动到另一个硬盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在我的一个本地硬盘上设置了git,但最终会将我所有的git仓库转移到另一个hdd(我想将我的工作文件从我自己的文件中分离出来,但我没有驱动器然而)。是否有可能通过拖放将这些本地工作git repos移动到新的硬盘上?



我有一台Mac OSX Lion,并且正在设置本地回购多台使用家庭NAS服务器作为母机的Mac。我仍然是这个git东西的初学者,所以任何提示都非常感谢。谢谢!

解决方案

是的,您可以简单地将所有文件复制到其他计算机上。但请确保也复制隐藏文件,即以点开头的文件。



以下链接指向一个页面,描述如何使隐藏文件出现在查找器中



每个git-repository都有一个名为 .git 的隐藏文件夹,位于其最上面的目录中。该文件夹包含所有历史记录,修订版等。在该文件夹中,您还可以找到一个名为 config 的文件,您可以在移动存储库后修改您的愿望。



<因此,基本上这个 .git 文件夹就是您的裸露项目文件和启用git的存储库之间的区别所在。


I'm currently setting up git on one of my local hdds, but will eventually be moving all my git repos on to another hdd (I want to split my work files from my own files, but I do not have the drives yet). Would it be possible to move those local work git repos to the new hdds by just dragging and dropping?

I have a Mac OSX Lion, and am setting up local repos for multiple macs that use my home NAS server as the mothership. I am still a beginner at this git stuff, so any tips are much appreciated. Thanks!

解决方案

Yes, you can simply copy all the files to your other computer. But make sure to also copy the "hidden" files, meaning the files that names are starting with a dot.

Here's a link to a Page describing how to make the hidden files appear in the finder.

Each and every git-repository has a hidden folder called .git in its top-most directory. This folder contains all the history, revisions and so on. Inside that folder you can also find a file called config, that you could modify to your wishes after moving the repository.

So basically this .git folder is everything that makes the difference between your bare project files and a git-enabled repository.

这篇关于如何将本地git回购从一个硬盘移动到另一个硬盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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