I am trying to do a GIT clone (I am new to GIT)
The command I use is:
C:\GIT>git clone --bare \\NAS1\GIT\OptiTexRepo \\backupnas\backup\GIT
Inside the \BACKUPNAS during the run I get several folders created. When they end, I get an error in my CMD windows
Cloning into bare repository \\backupnas\backup\GIT...
fatal: '\optitexnas\GIT\OptiTexRepo' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
And the folder on BACKUPNAS is deleted.
Running with –verbose does not add any new data to the screen.
What am I missing please?
What should the correct syntax be if I want to create a backup of my GITREPO?
- The GITREPO is located on a shared folder in our NAS (Readynas 1100 by Netgear)
- The server I run the command from has GIT installed and is a W2K3
EDIT:
It looks like the entire project is been copied, and at the end (after all the files are copied, I get the error message0 and than the entire directory is deleted again.
As long as
OptiTexRepois really a repository:Always use forward slashes for network paths when accessing them with
msysgit:This should clone
OptiTexRepointo yourbackupnas.Furthermore, in your comment on your question, you write that you have several repos present on
NAS1that you might back up. So it would be a good idea to give the clone a meaningful name:Another point: just cloning will put the current state of
OptiTexRepotobackupnas, but does not backup future states of the repo. The best way of backing up a git repo is working with it:git clone //NAS1/Git/OptiTexRepo D:/OptiTexwill create a working copy underD:/OptiTexgit commitin this repo (D:/OptiTex)git push --mirror originD:/OptiTexon//NAS1/Git/OptiTexRepo