我是靠谱客的博主 娇气鸵鸟,这篇文章主要介绍push文件 通过ssh_push文件到github,现在分享给大家,希望可以做个参考。

Administrator@PC201405042300 MINGW64 ~/.ssh

$ ssh-add ~/.ssh/id_dsa

Could not open a connection to your authentication agent.

Administrator@PC201405042300 MINGW64 ~/.ssh

$ ssh-add -l

Could not open a connection to your authentication agent.

Administrator@PC201405042300 MINGW64 ~/.ssh

$ ssh-agent -s

SSH_AUTH_SOCK=/tmp/ssh-qVs5D1HH3lyZ/agent.5644; export SSH_AUTH_SOCK;

SSH_AGENT_PID=3564; export SSH_AGENT_PID;

echo Agent pid 3564;

敲着几个命令 都是报告 Could not open a connection to your authentication agent.。说明权限除了问题。于是我执行了下面的这个命令,就是把密钥添加到ssh

Administrator@PC201405042300 MINGW64 ~/.ssh

$ ssh-add "C:UsersAdministrator.sshid_rsa"

Identity added: C:UsersAdministrator.sshid_rsa (C:UsersAdministrator.sshid_rsa)

于是再执行一遍$ ssh-add -l 试试,发生了以下的变化。

Administrator@PC201405042300 MINGW64 ~/.ssh

$ ssh-add -l

2048 SHA256:ifxlEcMnmLQ1DCeyW0pklMB3Zauz0CP1I/UGiEweUWE C:UsersAdministrator.sshid_rsa (RSA)

说明权限添加上了。

Administrator@PC201405042300 MINGW64 ~/.ssh

$ mkdir testqyl

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl

$ git init

Initialized empty Git repository in C:/Users/Administrator/.ssh/testqyl/.git/

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ touch README

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git add README

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git commit -m "first commit"

[master (root-commit) b7339ea] first commit

1 file changed, 0 insertions(+), 0 deletions(-)

create mode 100644 README

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git remote add originqinyinglian/testqyl

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git push -u origin master

Username for 'Build software better, together': qinyinglian

Counting objects: 3, done.

Writing objects: 100% (3/3), 210 bytes | 0 bytes/s, done.

Total 3 (delta 0), reused 0 (delta 0)

Branch master set up to track remote branch master from origin.

To qinyinglian/testqyl

* [new branch] master -> master

=======================分割线================

在testqyl 下创建一个目录helloworld.html文件,然后上传到github 的testqyl仓库里。

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ ls

helloworld.html README

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git add .

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git commit -m 'helloworld'

[master ea79a66] helloworld

1 file changed, 1 insertion(+)

create mode 100644 helloworld.html

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git remote add originqinyinglian/testqyl

fatal: remote origin already exists.

Administrator@PC201405042300 MINGW64 ~/.ssh/testqyl (master)

$ git push origin master

Username for 'Build software better, together': qinyinglian

Counting objects: 3, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (2/2), done.

Writing objects: 100% (3/3), 289 bytes | 0 bytes/s, done.

Total 3 (delta 0), reused 0 (delta 0)

To qinyinglian/testqyl

b7339ea..ea79a66 master -> master

最后

以上就是娇气鸵鸟最近收集整理的关于push文件 通过ssh_push文件到github的全部内容,更多相关push文件内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(106)

评论列表共有 0 条评论

立即
投稿
返回
顶部