GIT设置SSH公钥
来源:互联网 发布:mac上能玩哪些网络游戏 编辑:程序博客网 时间:2024/06/05 16:14
使用Git,一般可以使用http/https或者ssh连接。
使用http/https连接不需要额外的配置,但是如果工程中有一些比较大的文件,在push的时候经常会出现fatal: The remote end hung up unexpectedly的错误。
解决的办法是切换成使用ssh连接。这需要配置一个ssh公钥。步骤如下
1)进入$HOME/.ssh目录。如果没有创建过ssh密钥,目录为空。
$ cd ~/.ssh
$ ls
2)使用你的邮箱用ssh-keygen命令创建密码对。
$ ssh-keygen -t rsa -C "yourname@hotmail.com"
注意ssh-keygen命令中间没有空格,如果在ssh后面加上空格,会得到Bad escape character 'ygen'.的错误。
3)把公钥文件id_rsa.pub导入到git工程的公钥列表中
$ ls
github_rsa github_rsa.pub id_rsa id_rsa.pub
4)把remote地址改成ssh。
$ git remote remove origin
$ git remote add origin git@***.git
$ git branch -u origin/master master
$ git remote -v
阅读全文
0 0
- GIT设置SSH公钥
- GIT设置SSH公钥
- git设置ssh key
- Git 设置SSH Key
- git 设置 ssh key
- git 设置SSH认证
- git ssh 设置
- git设置ssh详细教程
- Git ssh免密设置
- Git-GitLab 设置添加SSH
- Git 服务器SSH公钥
- git 使用ssh公钥
- Git服务器 - ssh公钥
- Git-生成SSH公钥
- Git - 生成SSH公钥
- git .ssh 公钥
- Git生成 SSH 公钥
- Git 配置 ssh 公钥
- Java 创建线程的方法
- android多进程问题
- Mybatis知识点回顾/总结
- Oracle控制文件的修复及大数据文件的清除
- vs2015配置opengl的glm库
- GIT设置SSH公钥
- python中使用xlrd、xlwt操作excel表格详解
- from IPython import embed; embed()
- OFDPA软件概述
- mac添加AppleId失败的解决方法
- 5. Longest Palindromic Substring
- GDAL编译过程中的几个问题
- Python的thread
- 挑战程序竞赛系列(10):2.4并查集