GIT克隆-失败并删除了目标文件夹
我正在尝试做一个git克隆(我是新来的git),
我使用的命令是:
C:\GIT>git clone --bare \\NAS1\GIT\OptiTexRepo \\backupnas\backup\GIT
在运行期间\ backupnas内部,我会创建几个文件夹。当它们结束时,我会在CMD窗口中出现错误
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
,并且删除了备份中的文件夹。
使用-verbose运行不会在屏幕上添加任何新数据。
我想念什么? 如果我想创建gitrepo的备份,那么正确的语法应该是什么?
- Gitrepo位于我们的NAS(NetGear的ReadyNas 1100)中的共享文件夹上,
- 我从已安装的Git安装了命令,并且是W2K3
编辑: 看来整个项目已被复制,最后(在复制所有文件后,我会收到错误消息0,而将整个目录再次删除。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要
optitexrepo
实际上是一个存储库:始终使用 forward slashes 用
msysgit
:这应该克隆
optitexrepo
进入您的backupnas
。此外,在您对问题的评论中,您写道您在
nas1
上有几个存储库,您可能会备份。因此,给克隆人一个有意义的名称是一个好主意:另一点:仅克隆会将
optitexrepo的当前状态
backupnas
,但不会备份未来状态存储库。备份Git Repo的最佳方法是与之合作:git克隆// nas1/git/git/optitexrepo d:/optitex
将在d:/optitex
git commit
在此存储库中(d:/optitex
)git push将更改推向NAS - MIRROR ORICT
d:/optitex
上创建了// NAS1/git/optitexrepo
As long as
OptiTexRepo
is really a repository:Always use forward slashes for network paths when accessing them with
msysgit
:This should clone
OptiTexRepo
into yourbackupnas
.Furthermore, in your comment on your question, you write that you have several repos present on
NAS1
that 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
OptiTexRepo
tobackupnas
, 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:/OptiTex
will create a working copy underD:/OptiTex
git commit
in this repo (D:/OptiTex
)git push --mirror origin
D:/OptiTex
on//NAS1/Git/OptiTexRepo