Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
299 views
in Technique[技术] by (71.8m points)

migration - How can I copy my git repository from my windows machine to a linux machine via usb drive?

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.

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

See "How can I email someone a git repository?"

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

git clone myrepo.bundle
cd myrepo

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...