GIT克隆-失败并删除了目标文件夹

发布于 2024-12-04 16:53:54 字数 668 浏览 1 评论 0原文

我正在尝试做一个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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半寸时光 2024-12-11 16:53:54

只要optitexrepo实际上是一个存储库:

始终使用 forward slashes msysgit

git clone --bare //NAS1/GIT/OptiTexRepo //backupnas/backup/GIT

这应该克隆optitexrepo进入您的backupnas

此外,在您对问题的评论中,您写道您在nas1上有几个存储库,您可能会备份。因此,给克隆人一个有意义的名称是一个好主意:

git clone --bare //NAS1/GIT/OptiTexRepo //backupnas/backup/GIT/OptiTexRepo.git

另一点:仅克隆会将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:

git clone --bare //NAS1/GIT/OptiTexRepo //backupnas/backup/GIT

This should clone OptiTexRepo into your backupnas.

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:

git clone --bare //NAS1/GIT/OptiTexRepo //backupnas/backup/GIT/OptiTexRepo.git

Another point: just cloning will put the current state of OptiTexRepo to backupnas, 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 under D:/OptiTex
  • work and git commit in this repo (D:/OptiTex)
  • occasionally push your changes to the NAS using git push --mirror origin
  • Hey presto! Created a backup of D:/OptiTex on //NAS1/Git/OptiTexRepo
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文