我怎样才能通过USB驱动器将我的Windows机器上的git存储库复制到Linux机器上? [英] How can I copy my git repository from my windows machine to a linux machine via usb drive?
问题描述
我有一台运行在Windows桌面计算机上的git服务器,这台计算机无法解决连接互联网的问题。我想将回购移到一台linux机器上。我已经知道如何在创建完成后将克隆的回购站点指向新的主站点,但是我需要首先将其交给新的主站。
I have a git server running on a windows desktop machine that has inexplicably lost the ability to connect to the internet. I want to move the repo to a linux machine. I already know how to switch my cloned repos to point to the new master once it's setup, but I need to get it to a new machine first.
我假设自Windows和linux有点不同,我不能直接复制repo目录。但也许我可以?我的选择是什么?
I assume since windows and linux are a bit different, I can't just copy the repo directory verbatim. But maybe I can? What are my options?
推荐答案
你可以做一个git bundle:它会压缩一个文件中的repo。移动一个文件很容易,而不是所有文件的全部回购。
You can do a git bundle: it will compress the repo in one file. It is easy to move one file, as opposed to a all repo with all its files.
git bundle create /tmp/myrepo.bundle --all
在Linux上复制后,您可以从该文件克隆。 p>
Once copied on Linux, you can clone from that one file.
git clone myrepo.bundle
cd myrepo
这篇关于我怎样才能通过USB驱动器将我的Windows机器上的git存储库复制到Linux机器上?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!