How to move local git repo from one hdd to another hdd?

[亡魂溺海] 提交于 2019-12-18 12:14:57

问题


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!


回答1:


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.




回答2:


The git-data is stored in (invisible) folders in your git repo... so if you move the whole folder everything is alright. In Linux and Windows it does work this way, so hopefully for OSX , too.

You can try it out by creating a repo and move it btw ;)



来源:https://stackoverflow.com/questions/10774008/how-to-move-local-git-repo-from-one-hdd-to-another-hdd

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!