git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Migrating Repository without Network

From
KKKonstantin Khomoutov <kostix@bswap.ru>
Date
Oct 22, 2025, 09:04 UTC
Message-ID
<6tygbwc6ifpuo3xylsmsveufqyroazy35u4lyblnvuls3l7n3u@d4ail3s6vtoa>
In-Reply-To
<94497aac-c61a-4b17-9e4c-8ca9b966829c@bellsouth.net>
On Tue, Oct 21, 2025 at 10:21:52AM -0400, Dennis Putnam wrote:
> I have a server with a git repository whose NIC is no longer working. I need
> to migrate that repository to a new server using a flash drive. I can only
> find instructions for migrating when both servers have network access. Can
> someone tell me how to do a migration without using a network? TIA.

Note that Git repositories - both "bare" which are typical for servers [1] - and "normal" - which usually get created when the folks clone repositories from centralized locations, are self-containing, so what you should do is to just physcally copy the directory with the repository to the flash drive, recursively. Then make sure you have another copy of it, just in case you'll screw something later.

Then, once you have the repository on the flash drive, what to do heavily depends on how the access to that repository was provided - simply because there are many ways to do that - say, via SSH with several real system accounts, via SSH with a single "virtual" user, via HTTP[S] with the authentication provided by the mediating web server, and so on; it is also possible to combine these ways of access. It is also possible that the repo is under the control of some turn-key solution such as GitLab, Gitea etc. So, in the end, what to do next depends on what setup *around* that Git repo you have right now.

In either case, it will be possible to fetch all the data from the repo saved on the flash drive: it might be not exactly obvious but all Git commands which fetch data - such as "clone", "fetch" etc - do understand "plain" pathnames such as /the/path/to/the/repo and URLs with the special scheme "file://" - such as file:///the/path/to/the/repo, allowing them to work with on-disk repos available locally such as on a mounted flash drive.

 1. https://git-scm.com/book/en/v2/Git-on-the-Server-Getting-Git-on-a-Server
Previous: Junio C HamanoNext: Konstantin Khomoutov
Message 4 of 6 in “Migrating Repository without Network”
  1. Dennis PutnamOct 21, 2025
  2. D. Ben KnobleOct 21, 2025
  3. Junio C HamanoOct 21, 2025
  4. Konstantin KhomoutovOct 22, 2025
  5. Konstantin KhomoutovOct 22, 2025
  6. Dennis PutnamOct 22, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.