2011-02-17 73 views
0

我已经创建的Git仓库上的git 测试和安装的git我的Windows计算机上,混帐repositiory添加文件

Global setup: 

Download and install Git 
    git config --global user.name "Rahul Mehta" // i put here my name 
    git config --global user.email [email protected] 


Next steps: 

    mkdir Test //done 
    cd Test // .. 
    git init // done 
    touch README // 
    git add README // 
    git commit -m 'first commit' // running tthi give me erro 
    git remote add origin [email protected]:rahul23134/Test.git 
    git push origin master 

错误正在添加来了以后什么运行。

[email protected] ~/Test (master) 
$ git commit -m 'first commit' 
[master (root-commit) 3787ebd] first commit 
0 files changed, 0 insertions(+), 0 deletions(-) 
create mode 100644 README 

[email protected] ~/Test (master) 
$ git remote add origin [email protected]:rahul23134/Test.git 

[email protected] ~/Test (master) 
$ git push origin master 
The authenticity of host 'github.com (207.97.227.239)' can't be established. 
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. 
Are you sure you want to continue connecting (yes/no)? 
Host key verification failed. 
fatal: The remote end hung up unexpectedly 

[email protected] ~/Test (master) 
$ git push origin master 
The authenticity of host 'github.com (207.97.227.239)' can't be established. 
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. 
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of know 
n hosts. 
Permission denied (publickey). 
fatal: The remote end hung up unexpectedly 

[email protected] ~/Test (master) 
$ cd existing_git_repo 
sh.exe": cd: existing_git_repo: No such file or directory 

怎么我的自述文件将被COMMITED,我可以看到该文件https://github.com/rahul23134/Test在这里浏览器中的文件清单。

请建议应该做什么。

请同时提出学习git的基本步骤。

+0

@all我已经设置了git键并将一个文件提交到git,但我无法在该网站中看到该文件github.com/rahul23134/Test – XMen 2011-02-17 09:30:29

+0

@all现在我的问题得到解决,什么更多的intersting我可以在git上尝试使用它将会知道的有关git的东西? – XMen 2011-02-17 09:39:58

+0

在这里你有一个很好的答案,这个问题`http:// stackoverflow.com/questions/871/why-is-git-better-subversion` – 2011-02-17 09:47:25

回答

1

那么首先你没有犯什么:

0 files changed, 0 insertions(+), 0 deletions(-) 

不要忘记commiting之前,首先添加文件:

git add README 

第二个问题,它看起来像你没有权限推送到我们的存储库,最有可能意味着你没有把正确到位你的钥匙,检查本指南与github上生成你的钥匙

http://help.github.com/linux-key-setup/ 
0

你需要add文件才能提交它们。这是你的第一个错误。其次,你的ssh证书不会上传到Github上,所以当你试图推送时,它不知道你是谁。由于您使用的是github,因此Gnu/Linux的详细信息为here,Windows的详细信息为here

至于学习基础知识,我找到的最好的文档是progit book,git community bookgit reference card

如果你在印度,我会对你可以注册并参加的git进行公共培训。详细信息在我的网站上链接到我的个人资料。