新机git及github sshkey简单配置
新机git简单配置,毕竟不常用,不用每次都查
1、安装git
windows:https://git-scm.com/download/win
ubuntu: apt install git
2、全局配置
git config --global user.name "you_name"
git config --global user.email "your_email@gmail.com"
3、生成ssh-key
ssh-keygen -t rsa -b 4096 -C "your_email@gmail.com"
4、添加ssh到github 以后不用每次都输入邮箱及密码
cat ~/.ssh/id_rsa.pub
把输出的内容拷贝到github上
github 在https://github.com/settings/keys
点击左上角 New SSH key 把刚才的内容复制到下面的框里,点击Add SSH key
5、可以clone你自己的代码 然后修改提交了
如果新创建一个仓库也会有对应的提示:
echo "# test" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/crazypenguincode/test.git
git push -u origin master
git remote add origin https://github.com/xxx/test.git
git push -u origin master
参考:
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Open Terminal.
Paste the text below, substituting in your GitHub email address.
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
This creates a new ssh key, using the provided email as a label.
Generating public/private rsa key pair.
When you're prompted to "Enter a file in which to save the key," press Enter. This accepts the default file location.
Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]
- At the prompt, type a secure passphrase. For more information, see "Working with SSH key passphrases".
Enter passphrase (empty for no passphrase): [Type a passphrase]
Enter same passphrase again: [Type passphrase again]
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
Note: DSA keys were deprecated in OpenSSH 7.0. If your operating system uses OpenSSH, you'll need to use an alternate type of key when setting up SSH, such as an RSA key. For instance, if your operating system is MacOS Sierra, you can set up SSH using an RSA key.
Copy the SSH key to your clipboard.
If your SSH key file has a different name than the example code, modify the filename to match your current setup. When copying your key, don't add any newlines or whitespace.
$ sudo apt-get install xclip
# Downloads and installs xclip. If you don't have `apt-get`, you might need to use another installer (like `yum`) $ xclip -sel clip < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboardTip: If
xclip
isn't working, you can locate the hidden.ssh
folder, open the file in your favorite text editor, and copy it to your clipboard.In the upper-right corner of any page, click your profile photo, then click Settings.
In the user settings sidebar, click SSH and GPG keys.
Click New SSH key or Add SSH key.
- In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
Paste your key into the "Key" field.
Click Add SSH key.
If prompted, confirm your GitHub password.
新机git及github sshkey简单配置的更多相关文章
- git与github的简单使用教程
git与github的简单使用教程 一.创建仓库 点击new,进入创建仓库页面 对将要创建的仓库进行一些简单的设置 最后再点击create repository就可以了. 到这我们就创建好了一个仓库. ...
- Pycharm中Git、Github的简单使用和配置
Pycharm中Git.Github的使用 PyCharm本身自带了git,稍微配置一下就可以很好的在图形界面下进行Python项目的版本控制 配置Git 在配置前先新建一个项目,当然也可以打开已有的 ...
- git与github安装、配置、pull、push
操作系统是Ubuntu 16.04 LTS 64bit 1 安装git (1)安装 sudo apt-get install git-core (2)一些全局变量的初始化 在本地建立一个文件夹,然后做 ...
- git 与 github 最简单的用法
今天发现cygwin里已经装了git,所以顺便测试一下git是怎么用的. 大概最简单的用法是这样的: 1.在github创建一个repository.复制右边那个 HTTPS clone URL 2. ...
- git和github的简单配合使用
1.安装git,TortoiseGit. 2.用帐号A登陆github,建立一个版本仓库test1.用默认值创建就可以了. 3.在本机用TortoiseGit克隆仓库test1.直接选https开头的 ...
- windows下使用git时生成sshkey和配置
在windows下如何安装git就不介绍了,我这里主要使用的TortoiseGit,主要记录下在windows上如何通过sshkey链接git 在开始菜单中找到git bash,git bash是gi ...
- git 连接github.com 并配置密钥
传送门:http://www.jianshu.com/p/ff1034ed270e #备份ssh cd ~/.ssh $ ls $ mkdir key_backup //创建备份文件夹 $ cp id ...
- 小丁带你走进git世界一-git简单配置
小丁带你走进git世界一-git简单配置 1.github的简单配置 配置提交代码的信息,例如是谁提交的代码之类的. git config –global user.name BattleHeaer ...
- get最简单直接粗爆git与github教程
Git是分布式版本控制系统(可以理解为文件管理拓展工具) github一个在线文件托管系统(可以理解为一个在线云盘) 准备工作,在git官网下载git软件件,安装git软件,以windows.为例,下 ...
随机推荐
- Javascript登录页面“记住密码”实现
JS记住密码实现效果: JavaScript Code 1234567891011121314151617181920212223242526272829303132 <!DOCTYPE ...
- oralce函数
1.trunc函数处理数字和日期TRUNC(NUMBER[,DECIMAL]) 数字格式TRUNC(DATE[,FOMAT]) 日期格式2.round函数(四舍五入)ROUND(NUMBER[,DEC ...
- Eclipse Android 代码自己主动提示功能
Eclipse Android 代码自己主动提示功能 Eclipse for android 实现代码自己主动提示智能提示功能.介绍 Eclipse for android 编辑器中实现两种主要文件 ...
- Rnqoj (未出现的子串)
题目链接:传送门 题目大意:略: 题目思路:DP思想 读入数据后,从后向前遍历,假如我们是要找一个长度为n的以1开头的数字串的所有序列,那么可以将它表示为1+(任意数开头的长度为n-1的序列) 然后我 ...
- CF678D(Iterated Linear Function)
题目链接:传送门 题目大意:略 题目思路:用题目所给函数推出表达式,然后用等比求和公式得到关系式套用即可(需用乘法逆元),也可直接构造矩阵,用矩阵快速幂求解. 感受:做题时一定要仔细,需要仔细注意什么 ...
- iOS UITableView划动删除的实现
标签:划动删除 iphone 滑动删除 ios UITableView 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://rainb ...
- Java日期类:Date和Calendar的使用
总是使用这两个类,总是需要百度.还不如一次全部整理完. 一.介绍: Date 类 Date 表示特定的瞬间,精确到毫秒. 在 JDK 1.1 之前,类 Date 有两个其他的函数.它允许把日期解释为年 ...
- FineReport----单元格元素(数据列、公式、斜线)
一.绑定.插入数据列 数据集字段绑定 二.公式 1.单元 格计算 1.两个单元格(C7,I7)和 2.等于某单元格的值 D7等C7单元格的值 3.C7/8(除) 4.除数被除数为零.空的处理 http ...
- sql---如何把sql查询出来的结果当做另一个sql的条件查询,1、语句2、with as
'; -- table2 的 name 作为 table1的条件 select * from table1 where name in (select name from table2) --如果有多 ...
- shell脚本读取文件+读取命令行参数+读取标准输入+变量赋值+输出到文件
读取url_list文件批量下载网页 url_list http://www.tianyancha.com/company/2412078287 http://www.4399.com/special ...