Wednesday, 10 May 2017

[Git]Push code to Github Error.



剛開始學Git 時,都是用工具像是github,TortoiseGit,沒有用指令。最近開始用指令,就發現很多都不懂的。

主要是因為當我要push code to github 時遇到這個問題。

> git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

基本上是照著下面這篇


http://blog.csdn.net/jingtingfengguo/article/details/51892864

去做把code push to GitHub 但是就是發生錯誤。在最後一步一直發生問題,我太懶 ,在yes/no時都是按enter,而沒有輸入yes,就一直找解答,其實只要按yes就好了 。
Image result for the authenticity of host can't be established. rsa key fingerprint is git

在git中輸入命令:

ssh -T git@github.com


這個命令是用來測試是否連線上的,

第一個就是很多觀念都不懂

http://www.cnblogs.com/hustskyking/p/problems-in-git-when-ssh.html

像是什麼是 known_hosts 文件

https://segmentfault.com/a/1190000004317077


另一篇
http://blog.sina.com.cn/s/blog_4c44643f0102vuju.html




在git中輸入命令:

ssh -T git@github.com  發生錯誤 



Solution: 

Generate ssh key again. 



 Go to folder



Open id_rsa.pub and copy the content of file

Go to your github setting  --> SSH and GPG keys


Past the content into Key filed  and name the title whatever you want


Test to connect github again. 

Clone your repo by git again. 



No comments:

Post a Comment

how-to-recursively-create-subfolder-in-each-folder-of-a-directory-in-cmd

test.cmd: @echo off setlocal for /f "usebackq tokens=*" %%a in (`dir /b /a:d`) do ( rem enter the directory pushd %%a echo...