上传代码至bitbucket 及遇到的问题汇总

1,用服务器上的空仓库生成.hg文件

hg clone your-url

2,将生成的.hg目录拷到要上传的本地仓库目录下(初始时hg init)

3,添加要上传的文件到本地仓库

hg add

4,将代码提交到本地仓库

hg commit

5,将本地仓库的代码提交到服务器

hg push your-url

可能遇到的问题汇总:

Q:中止: 此处没有水银版本库(没有找到 .hg)!
A:hg init
Q:
yu@MCW-xnYu:~/memcache/Bitbucket_repository$ hg clone ssh://[email protected]/***/***
The authenticity of host 'bitbucket.org (207.223.240.182)' can't be established.
RSA key fingerprint is 97:8c:1b:f2:6f:14:6b:5c:3b:ec:aa:46:46:74:7c:40.
Are you sure you want to continue connecting (yes/no)? yes
remote: Warning: Permanently added 'bitbucket.org,207.223.240.182' (RSA) to the list of known hosts.
remote: Permission denied (publickey).
中止: no suitable response from remote hg!
A:
1.http://www.ganguoyuan.com/06/linux%E4%B8%ADssh%E7%99%BB%E5%BD%95permanently-added-rsa-to-the-list-of-known-hosts%E9%97%AE%E9%A2%98%E8%A7%A3%E5%86%B3/

2.用https代替
Q
Mercurial: warning: bitbucket.org certificate with fingerprint XXXXXXXXX not verified (check hostfingerprints or web.cacerts config setting)
A:
http://tadabborat.tumblr.com/post/9502320721/mercurial-warning-bitbucket-org-certificate-with
Q
warning: bitbucket.org certificate with fingerprint 24:9c:45:8b:9c:aa:ba:55:4e:01:6d:58:ff:e4:28:7d:2a:14:ae:3b not verified (check hostfingerprints or web.cacerts config setting)
A:

The solution1:
Add the following lines to the .hgrc file which is located in your home directory (if the file is not there create it).
[hostfingerprints]
www.bscmsrc.eu = e1:0e:46:81:37:20:33:aa:42:c0:98:d7:e9:7f:c6:19:7a:ee:d5:37


Assuming that e1:0e:46:81:37:20:33:aa:42:c0:98:d7:e9:7f:c6:19:7a:ee:d5:37 is the fingerprint for your host (displayed in the warning message).

And this should be enough to not see the warning message anymore.
The solution2:
from
http://stackoverflow.com/questions/5066696/how-to-checkout-the-source-code-from-mercurial

The problem is, that you didn't added the fingerprint of google to your hgrc file.There are two ways to solve the problem:
    Use http instead of https, the disadvantage would be, that your traffic isn't encrypted anymore.
        hg clone http://xmppframework.googlecode.com/hg/ xmppframework
    Or add the fingerprint to you hgrc file:
    Please note that Google Code is changing the fingerprint sometimes. When the fingerprint below doesn't work, you can use this command (taken from thisquestion) to detect the current fingerprint:
        $ openssl s_client -connect xmppframework.googlecode.com:443 < /dev/null 2>/dev/null | openssl x509 -fingerprint -noout -in /dev/stdin
                [hostfingerprints]
        xmppframework.googlecode.com = b1:af:83:76:f3:81:b0:57:70:d8:07:42:c8:c1:b3:67:38:c8:7a:bc

Edited because original answer was ugly.

Q
abort: no username supplied (see "hg help config")
A:
在hg中输入commit 指令时,如果出现下述结果:
$ hg commit
abort: no username supplied (see "hg help config")
则按照下述步骤进行设置
Step 1:在当前目录中输入:
$ cd .hg
Step 2:修改在.hg目录下的hgrc文件:
$ notepad hgrc
hgrc文件的内容为:
[paths]
default = http://www.selenic.com/repo/hello
Step 3:在该文件中加入下述代码:
[ui]
username = Ethan Zhang <[email protected]>


username后面可以是只有名称或E-mail,上面是完整的显示方式。

部分摘自:

http://blog.csdn.net/xunlei842/article/details/7051893

你可能感兴趣的:(c,Google,File,服务器,mercurial)