如何通过 USB 驱动器将我的 git 存储库从我的 windows 机器复制到 linux 机器? [英] How can I copy my git repository from my windows machine to a linux machine via usb drive?

查看:23
本文介绍了如何通过 USB 驱动器将我的 git 存储库从我的 windows 机器复制到 linux 机器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个运行在 Windows 桌面机器上的 git 服务器,它莫名其妙地失去了连接到互联网的能力.我想将 repo 移动到 linux 机器上.我已经知道如何将克隆的 repos 切换为设置后指向新的 master,但我需要先将它放到新机器上.

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 压缩到一个文件中.与包含所有文件的所有 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

请参阅如何通过电子邮件向某人发送 git 存储库?"

在 Linux 上复制后,您可以从该文件进行克隆.

Once copied on Linux, you can clone from that one file.

git clone myrepo.bundle
cd myrepo

这篇关于如何通过 USB 驱动器将我的 git 存储库从我的 windows 机器复制到 linux 机器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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