0

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 .

XMen
  • 29,384
  • 41
  • 99
  • 151
  • @all I had setup the git key and commit the one file to the git but i am not able to see that file in the site github.com/rahul23134/Test – XMen Feb 17 '11 at 09:30
  • @all my problem is solved now , what more intersting thing i can do on git for trying to use what it will beneifit to know about git ? – XMen Feb 17 '11 at 09:39
  • here you have a great answer to that question `http://stackoverflow.com/questions/871/why-is-git-better-than-subversion` – Fernando Diaz Garrido Feb 17 '11 at 09:47

4 Answers4

1

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/
Fernando Diaz Garrido
  • 3,995
  • 19
  • 22
  • @Fernado I had setup the git key and commit the one file to the git but i am not able to see that file in the site https://github.com/rahul23134/Test – XMen Feb 17 '11 at 09:30
  • you have to make `git push origin master` if it keeps getting the error `Permission denied (publickey).` then you still have problems with the keys (check that the key has only read permission for the owner with `chmod 0400 ~/.ssh/id_rsa*`) – Fernando Diaz Garrido Feb 17 '11 at 09:34
1

Please read this, I think it should help:

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

Or this URL: http://help.github.com/troubleshooting-ssh/ (Permission denied (publickey))

Which is the exact same error you have.

Antoine Pelisse
  • 12,871
  • 4
  • 34
  • 34
0

I learned it by following this guide http://www.kernel.org/pub/software/scm/git/docs/everyday.html and when done and as reference http://git-scm.com/

drahnr
  • 6,782
  • 5
  • 48
  • 75
0

You need to add files before you can commit them. That's your first mistake.

Secondly, your ssh credentials are not uploaded on Github so it doesn't know who you are when you try to push. Since you're using github, the details are here for Gnu/Linux and here for Windows.

As for learning the basics, the best documentation I've found are the progit book, git community book and the git reference card.

If you're in India, I conduct public trainings on git which you can register for and attend. The details are on my website linked to from my Profile.

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169
  • The readme file is empty, that's why the 0 insertion. Obviously the file has been committed: 'create mode 100644 README' – Antoine Pelisse Feb 17 '11 at 09:17
  • If you've added a `0` byte file, it's fine. Git will track that for you. After you commit, try doing a `git log` and you will be able to see the commit. The pushing is not working because of an ssh setup problem. – Noufal Ibrahim Feb 17 '11 at 09:19