github使用gitbash推送下载

1、浏览器登录github账号,设置里面找ssh秘钥,new 一个秘钥,先用git bash生成一个秘钥,

      假设没有秘钥,新生成秘钥默认在安装路径下的.ssh文件夹下。

Administrator@smy MINGW64 ~
$ ssh-keygen -t rsa -C "你git账号绑定的邮箱"
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/Administrator/.ssh/id_rsa):(此处直接回车)
Enter passphrase (empty for no passphrase):(此处直接回车)
Enter same passphrase again:
Your identification has been saved in /c/Users/Administrator/.ssh/id_rsa.(默认生成在你安装目录下.ssh文件下)
Your public key has been saved in /c/Users/Administrator/.ssh/id_rsa.pub.(默认生成在你安装目录下.ssh文件下)
The key fingerprint is:
SHA256:sh9W/OO5fU2FheVa4srercNKiAi+qWOpQg3rnExD6KE 你git账号绑定的邮箱
The key's randomart image is:
+---[RSA 2048]----+
|               o.|
|              ...|
|.             .oo|
|.+       .   ..+.|
|+ = . . S o   o .|
|E* o . + o + .  .|
|* o.. o + . *. ..|
|.=+  o o . + =o.o|
|oo.oo   .   *o++.|
+----[SHA256]-----+

把生成的pub文件的内容全部复制,是全部复制然后粘贴到ssh秘钥处,并设置title用来区分不同的设备。


2、git bash连接github

Administrator@smy MINGW64 ~
$ ssh -T git@github.com(拷贝此命令直接回车)
The authenticity of host 'github.com (192.30.255.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes(输入yes)
Warning: Permanently added 'github.com,192.30.255.113' (RSA) to the list of known hosts.
Enter passphrase for key '/c/Users/Administrator/.ssh/id_rsa':(此处自己设置密码会输入两次)
Received disconnect from 192.30.255.113 port 22:11: Bye Bye
Connection to github.com closed by remote host.
3、下载一个github上的项目

Administrator@smy MINGW64 /h/smy/github
$ git clone 输入要克隆的地址
Cloning into 'Test'...
remote: Counting objects: 8, done.
remote: Total 8 (delta 0), reused 0 (delta 0), pack-reused 8
Unpacking objects: 100% (8/8), done.
4、推送本地文件去remote仓库

git add .    
git commit -m '注释说明'
git push -u origin master


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值