1

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.

Rohit Gupta
  • 4,022
  • 20
  • 31
  • 41

2 Answers2

2

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.

tymtam
  • 31,798
  • 8
  • 86
  • 126
2

The alternative to copy the full directory structure is a git bundle (see "Fully backup a git repo?").

That way, you have only one file to copy, that you can clone from (yes, clone from a file) on the target system.

git clone foo.bundle
cd foo
git remote set-url origin url-to-original-repository
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250