标签:terminal opera white 密码 log match ssh key inf min
新机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你自己的代码 然后修改提交了
参考:
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]
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 clipboard
Tip: 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.
标签:terminal opera white 密码 log match ssh key inf min
原文地址:http://www.cnblogs.com/zhishuai/p/7850595.html