Reputation: 60935
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?
Upvotes: 4
Views: 6527
Reputation: 142352
As suggested before you can create bundle. but bundle is a read-only repo.
It's the most simple thing to do: simply copy the root folder of your project (it must include the .git
inside). Copy it to your USB and then to your Linux machine.
The only thing you will have to worry about is CRLF. which is the way git handles line feed.
On windows, it should have the value of true while on Linux it should have the value of the input as shown below
# Linux based OS should be:
git config --global core.autocrlf input
# Windows configuration
git config --global core.autocrlf true
Upvotes: 7
Reputation: 1326746
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
Upvotes: 21