1

我有一个名为“Proyectos”的目录,里面有 Django 代码。

我需要将项目提交到 Source Forge,这样我的老师就可以将所有代码“下载”到他的计算机上。

我想我应该使用其中一些地址:

http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/phone-apps-djan (read-only) 
 ssh://lucasab@phone-apps-djan.hg.sourceforge.net/hgroot/phone-apps-djan/phone-apps-djan (read/write)

我在 Kubuntu 上做了这个:

lucas@lucas-Satellite-L305:~/Desarrollo/Python/Django/Proyectos$ hg clone http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/django-mercurial

但只创建文件夹。

我是新手,没有找到如何做到这一点。我遵循了一些教程,但我无法理解很多概念。

我将不胜感激这方面的一些帮助,请。

提前致谢。

4

3 回答 3

2

您有两个不同的地址可以访问 sourceforge 上的 Mercurial 存储库:

  1. http://phone-apps-djan.hg.sourceforge.net:8000/hgroot/phone-apps-djan/phone-apps-djan (read-only),就像地址后面说的,这个是只读的,是给大家克隆你的项目的,所以他们可以看到源代码并编译/使用它。没有身份验证。当您使用此地址时,Mercurial 使用 HTTP 协议来拉取更改。
  2. ssh://lucasab@phone-apps-djan.hg.sourceforge.net/hgroot/phone-apps-djan/phone-apps-djan (read/write),您可以通过此地址写入您的存储库,但您必须对自己进行身份验证(您必须输入密码)并且 Mercurial 使用 SSH 协议来执行此操作。您还可以在地址中看到您的 sourceforge 用户名。

首先,您必须使用第二个地址再次克隆您的项目,否则您将无法提交。只需cd在一个新目录中执行:

hg clone ssh://lucasab@phone-apps-djan.hg.sourceforge.net/hgroot/phone-apps-djan/phone-apps-djan

系统会提示您输入 sourceforge 帐户密码。

然后,您可以在新创建的目录中 cd,进行所有更改,添加文件等。完成后,您可以执行 ahg commit和 ahg push以将修改发布到您的存储库。如果您将新文件添加到目录中,请不要忘记执行 ahg addhg addremove.

你可以在Hg Init上找到一个非常好的和简单的关于 mercurial 的教程,你应该在 sourceforge 上做任何事情之前阅读它并尝试理解工作流程。

祝你的项目好运:)

于 2011-05-29T12:26:49.110 回答
2

非常感谢 Rob Sobers 和 Krtek 的回答。我终于可以将所有文件添加到 SourceForge。我听从了他们的指示,一切都很顺利,尽管我有一些小并发症。

这是我逐步回答的问题:

在文件夹“Proyectos”上我做了:

  • hg clone ssh://lucasab@phone-apps-djan.hg.sourceforge.net/hgroot/phone-apps-djan/phone-apps-djan并输入我的 SourceForge 帐户的密码。创建了一个文件夹“phone-apps-djan”。

  • hg add在我cd进入phone-apps-djan并将我的项目的所有文件复制到该文件夹​​中之后。

  • hg commit. 此时出现错误:abort: no username supplied (see "hg help config"). 所以我创建了一个.hgrc在我的主目录中命名的文件并添加了这些行:

    [ui]
    username = my username at sourceforce <the mail address I supplied when registering>
    verbose = True
    

然后我重新进入hg commit

  • hg push. 显示以下错误消息:abort: repository default-push not found!。然后我重新编辑了上一步创建的 .hgrc 文件并添加了:

    [paths]
    default = ssh://lucasab@phone-apps-djan.hg.sourceforge.net/hgroot/phone-apps-djan/phone-apps-dja
    

我真的不明白这里发生了什么,因为.hg我的仓库中的目录已经包含一个hgrc具有该路径的文件:(。无论如何,我又做hg push了一次。

仅此而已。

于 2011-05-29T15:50:48.640 回答
1

将存储库hg clone下载到您的计算机。现在,要更新您的工作目录(以便您可以使用文件),请键入hg update.

完成更改后,键入hg commit以记录它们。当您准备好将更改上传到 SourceForge 时,输入. 确保您推送到正确的存储库!hg push http://path/to/repo

于 2011-05-28T18:27:32.223 回答