creating new remote repository for existing project with Mercurial

谁说我不能喝 提交于 2019-12-04 04:47:30

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.

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:

  • Your friends need ssh accounts
  • your friends accounts need read/write access to /home/hg/repos

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

Seriously, just use bitbucket.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!