使用Mercurial为现有项目创建新的远程存储库 [英] creating new remote repository for existing project with Mercurial

查看:91
本文介绍了使用Mercurial为现有项目创建新的远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有version.2的项目,我必须开始着手开发新的version.3. 我想在远程服务器(即Mercurial服务器)上创建一个新的存储库,以便我的团队成员可以访问该存储库.我的项目文件存储在本地计算机上.

I have a project with version.2 and i have to start working on it to develop a new version.3 . I want to create a new repo on a remote server (i.e. a mercurial-server) so that my team member could access that repo .I have my project file on my local machine .

我有两个有关的问题:

  1. 如何在带有我的项目文件的远程mercurial-server的/home/hg/repositories/private/project3中创建它(假设新的回购名称为project3).我应该按照什么步骤进行操作.

  1. How can I create it in /home/hg/repositories/private/project3 (Lets say new repo name would be project3) of remote mercurial-server with my project files. What steps should I follow to do this.

如何创建访问权限(usrname/pword),以便我的团队可以在

How can I create a access permission (usrname/pword) so that my team will access this repo on http://dev.myproject.com/private/project3 .

注意:/home/hg/repositories/ http://dev.myproject.com/的默认设置并且我没有版本2的仓库(我猜是不可能克隆的!)

Note: /home/hg/repositories/ is default for http://dev.myproject.com/ and I have no repo of version 2 (clone is not possible I guess! )

推荐答案

如果不安装其他服务器端软件,您的团队将需要在该框中使用ssh帐户.我假设您有一个,并且可以为您的朋友创建它们.如果您没有该设置,那么最好只使用bitbucket,它是免费的,并且提供ssh和ftp访问.

Without installing additional server side software your team will need ssh accounts on that box. I'm assuming you have one and that you can create them for your friends. If you don't have that setup you're better off just using bitbucket, which is free and provides both ssh and ftp access.

此外,您没有说出project2是否已经在Mercurial的控制之下,所以我假设它不是.

Also, you don't say if you project2 is already under Mercurial control, so I'm assuming it's not.

要创建远程仓库,您可以在本地计算机上执行以下操作 :

To create the remote repo you'd do something like this on your local machine:

hg init project3   # <-- creates a new empty respository
cp ALL_THE_PROJECT3_FILES_YOU_WANT project3  # <--- put the files you want into project3
cd project3   # <-- go into your local project3 repository
hg addremove   # <-- LOCALLY add the files you copied in
hg commit -m "initial commit copied in project2"  # <-- LOCALLY commit the files
cd ..   # <---- go up a directory
hg clone project3 ssh://yourusername@dev.myproject.com//home/hg/repos/project3  # clone the repo over to the server

您的队友然后可以使用以下命令克隆下来:

Your teammates can then clone down using:

hg clone ssh://theirusername@dev.myproject.com//home/hg/repos/project3

有些事情可能会在使该工作正常进行的过程中不小心弄乱:

Here are some things you could accidentally mess up on the way to getting this working:

  • 您的朋友需要ssh帐户
  • 您的朋友帐户需要对/home/hg/repos
  • 的读/写权限
  • Your friends need ssh accounts
  • your friends accounts need read/write access to /home/hg/repos

请注意,所有克隆都是通过ssh进行的.设置HTTP更加困难,可能不需要做.

Notice that all cloning is happening over ssh. Setting up HTTP is harder and probably not something you need to do.

严重的是,只需使用bitbucket.

Seriously, just use bitbucket.

这篇关于使用Mercurial为现有项目创建新的远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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