github使用入门

1 在本机安装git

2 注册一个github账户

3 生成ssh-key,并添加到github账户

Generating a new SSH key and adding it to the ssh-agent

3.1 Generating a new SSH key

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

3.2 adding your ssh to the ssg-agent

  1. Start the ssh-agent in the background.
eval "$(ssh-agent -s)"
  1. If you’re using macOS Sierra 10.12.2 or later, you will need to modify your ~/.ssh/config file to automatically load keys into the ssh-agent and store passphrases in your keychain.
Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa
  1. Add your SSH private key to the ssh-agent and store your passphrase in the keychain. If you created your key with a different name, or if you are adding an existing key that has a different name, replace id_rsa in the command with the name of your private key file.
ssh-add -K ~/.ssh/id_rsa

3.3 复制

# win
clip < ~/.ssh/id_rsa.pub

# mac
pbcopy < ~/.ssh/id_rsa.pub

# linux
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_rsa.pub

4 运行前的配置

git config --global user.name "your_name"
git config --global user.email "your_email@example.com"
git config --global core.editor vim
git config --global color.ui auto
# git status时中文文件夹或者文件名不正常显示时
git config --global core.quotepath false
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张欣-男

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值