自动将存储库克隆到网络驱动器的最佳策略是什么? [英] whats the best strategy for automatically cloning a repo to a network drive?

查看:90
本文介绍了自动将存储库克隆到网络驱动器的最佳策略是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在本地计算机上的SVN下有一个存储库.由于各种原因,我正在使用的SVN分支被锁定,因此我不应该再创建另一个分支.我希望能够通过Mercurial进行许多本地提交,然后将这些更改复制/推送到网络驱动器,以便每晚进行备份.当SVN分支再次打开时,我将最后的更改推送到该分支.

I have a repository on my local machine that is under SVN. For various reasons the SVN branch that I'm working on is locked and I'm not supposed to make another branch. I'd like to be able to make many local commits via Mercurial, then copy/push those changes up to a network drive so that they're backed up every night. When the SVN branch is open again I'll push the final changes up to it.

这似乎都与众不同.我做了我的本地仓库,对其进行了一些更改并提交了它们.然后,我在远程驱动器上做了一个空的仓库,并尝试hg push进行更改.几个小时后,仅完成了33%.总回购大约为80MB(代码文件夹中为6.7GB的文件).我真的不想每次提交都整天等待.

None of this seems out of the ordinary. I made my local repo, made some changes to it and commited them. Then I made an empty repo on the remote drive and tried to hg push the changes. After several hours it was only 33% done. The total repo is about 80MB (6.7GB of files in the code folder). I really don't want to wait all day every time I make a commit.

我决定将hg push装袋,然后改用hg clone.

I decided to bag the hg push and use hg clone instead.

它是这样的(使用PowerShell):

It went like this (using PowerShell):

PS C:\Dev\Projects\Project1> hg status
PS C:\Dev\Projects\Project1> hg clone H:\Repo\Projects
**abort: repository H:\Repo\Projects not found!**

好,所以我显然需要在H:\ Repo \ Projects中存在一个存储库.因此,我去了那里,并使用hg init制作了一个空的存储库.之后,我尝试以下方法:

Ok, so I apparently need a repository in H:\Repo\Projects. So I go over there and use hg init to make an empty repository. After that I try this:

PS C:\Dev\Projects\Project1> hg clone H:\Repo\Projects
destination directory: Projects
**abort: destination 'Projects' is not empty**

Mercurial在这里想要什么?空目录?好吧,那就找不到仓库了.一个空的回购?不,然后它告诉我目的地不为空.像hg clone H:\Repo\Projects\TheNewFolder这样的全新文件夹?不,然后收到未找到回购消息.

What does Mercurial want here? An empty directory? Well no, then it can't find a repo. An empty repo? No then it tells me that the destination is not empty. A brand new folder like hg clone H:\Repo\Projects\TheNewFolder? No, then I get a repo not found message.

执行此操作的最佳方法(或任何方法)是什么?我似乎被困在整日忙"或根本不工作"之间.

What's the best way (or any) way to do this? I seem to be stuck between "takes all day" or "doesn't work at all".

推荐答案

如果您在C:\Dev\Projects\Project1中,并且想要将其克隆到H:\Repo\Projects,则命令为cd ..,后跟hg clone Project1 H:\Repo\Projects,表示克隆Project1到那里.您试图将H:\Repo\Projects克隆到当前目录中.

If you're in C:\Dev\Projects\Project1 and you want to clone it to H:\Repo\Projects the command is cd .. followed by hg clone Project1 H:\Repo\Projects which says clone Project1 to there. You were trying to clone H:\Repo\Projects into the current directory.

克隆不会比推送更快-克隆只是hg init ; hg pull.

Clone won't be any faster than push -- clone is just hg init ; hg pull.

没有理由将您的80MB存储库(除非您的意思是80GB)花费一秒钟以上的时间来推送/拉入一个新的空存储库.如果它是80GB,那么一次传输只会很慢,此后推/拉将只发送新的变更集.

There's no reason your 80MB repo (unless you meant 80GB) should take more than a blink to push/pull to a new empty repo. If it was 80GB it'll only be slow that once and henceforth push/pull will just send the new changeset.

这篇关于自动将存储库克隆到网络驱动器的最佳策略是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆