[英]git repositiory adding files
我在git上创建了git repository Test并在我的windows机器上安装了git
Global setup:
Download and install Git
git config --global user.name "Rahul Mehta" // i put here my name
git config --global user.email rahul23134654@gmail.com
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 git@github.com:rahul23134/Test.git
git push origin master
在发生什么错误之后运行。
Administrator@RAHUL ~/Test (master)
$ git commit -m 'first commit'
[master (root-commit) 3787ebd] first commit
0 files changed, 0 insertions(+), 0 deletions(-)
create mode 100644 README
Administrator@RAHUL ~/Test (master)
$ git remote add origin git@github.com:rahul23134/Test.git
Administrator@RAHUL ~/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
Administrator@RAHUL ~/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
Administrator@RAHUL ~/Test (master)
$ cd existing_git_repo
sh.exe": cd: existing_git_repo: No such file or directory
我的自述文件将如何提交,我可以在浏览器中查看文件https://github.com/rahul23134/Test文件列表。
请建议应该做什么。
并且还请建议学习git的基本步骤。
首先,你没有做任何事情:
0 files changed, 0 insertions(+), 0 deletions(-)
不要忘记在提交前先添加文件:
git add README
第二个问题,看起来你没有权限推送到我们的存储库,很可能意味着你没有正确放置你的密钥,请查看本指南,以便使用github生成密钥
http://help.github.com/linux-key-setup/
请阅读本文,我认为它应该有所帮助:
http://help.github.com/msysgit-key-setup/
或者这个URL: http : //help.github.com/troubleshooting-ssh/ (Permission denied(publickey))
你遇到的错误完全相同。
我按照本指南http://www.kernel.org/pub/software/scm/git/docs/everyday.html了解了这一点,完成后作为参考http://git-scm.com/
您需要先add
文件,然后才能提交它们。 那是你的第一个错误。
其次,您的ssh凭据不会上传到Github上,因此当您尝试推送时它不知道您是谁。 由于您使用的是github,因此Gnu / Linux和Windows的详细信息都在 这里 。
至于学习基础知识,我发现的最好的文档是progit book , git community book和git reference card 。
如果你在印度,我会对git进行公开培训,你可以注册并参加。 详细信息在我的网站链接到我的个人资料。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.