Can I just physically copy my remote GIT repository to another machine with different OS

Viewed 70

At the moment my remote repository is on my development PC (Windows) on a separate drive. I want to move it to my Synology NAS box.

When I Google it, I can only find very complicated methods. Is there anything wrong if I physically copy the directory structure over (I know it's a different OS, but surely the files should be the same). I have "core.autocrlf" set to false.

Before someone tells me, it should be outside my house, I have a NAS box at my batch, and I intend to replicate information there.

2 Answers

Git repos are self contained and copying will be fine; just make sure you're copying 'hidden' folders ('.git').

You could also just clone the repo to the new machine as each clone contains the full history.

From git's About:

Multiple Backups

This means that even if you're using a centralized workflow, every user essentially has a full backup of the main server. Each of these copies could be pushed up to replace the main server in the event of a crash or corruption. In effect, there is no single point of failure with Git unless there is only a single copy of the repository.

Related