git repositiory添加文件 [英] git repositiory adding files

查看:202
本文介绍了git repositiory添加文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在git上创建了git仓库 Test ,并在我的Windows机器上安装了git,并且

 全局设置:

下载并安装Git
git config --global user.nameRahul Mehta//我把我的名字放在这里
git config --global user.email rahul23134654@gmail.com


下一步:

mkdir测试//完成
cd测试// ..
git init / / done
touch README //
git add README //
git commit -m'第一次提交'//运行tthi给我错误
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]第一次提交
0个文件已更改,0个插入(+),0个删除( - )
创建模式100644自述文件

管理员@ RAHUL〜/测试(master)
$ git remote add origin git@github.com:rahul23134 / Test.git

Administrator @ RAHUL〜/ Test(master)
$ git push origin master
主机'github.com(207.97.227.239)'的真实性无法建立。
RSA密钥指纹是16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48。
您确定要继续连接(是/否)吗?
主机密钥验证失败。
致命:远程端意外挂起

管理员@ RAHUL〜/测试(master)
$ git push origin master
主机的真实性'github.com (207.97.227.239)'无法建立。
RSA密钥指纹是16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48。
您确定要继续连接(是/否)吗?是
警告:永久性地将'github.com,207.97.227.239'(RSA)添加到已知的
n主机列表中。
权限被拒绝(publickey)。
致命:远程端意外挂起

管理员@ RAHUL〜/测试(master)
$ cd existing_git_repo
sh.exe:cd:existing_git_repo:否这样的文件或目录

我的自述文件将如何提交,我可以看到该文件 https://github.com/rahul23134/Test 在浏览器中列出文件。



请建议应该做什么。



并且请提出学习git的基本步骤。
<首先你没有提交任何东西:

  0文件更改,0插入(+),0删除( - )

不要忘记首先添加文件提交前:

  git add自述文件

第二个问题,看起来您没有权限推送到我们的存储库,最有可能意味着您没有把你的密钥放在正确的位置,查看本指南,以便用github生成你的密钥。

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


I had creating git repository Test on git and installed git on my windows machine and

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

Running after comming what errors are coming .

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

how my readme file will be commited and i can see that file https://github.com/rahul23134/Test here in browser in listing of files.

Please suggest what should be do.

and Please also suggest the basic step to learn the git .

解决方案

Well first of all you didnt commit anything:

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

Dont forget to first add your files before commiting:

git add README

Second problem, it looks like you don't have permissions to push to our repository, what most likely means you didn't put correctly in place your keys, check this guide for generating your keys with github

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

这篇关于git repositiory添加文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆