ssh-keygen -t rsa -b 4096 -C "[email protected]"
...
Enter a file in which to save the key (/home/you/.ssh/algorithm): <key_name>
Enter passphrase (empty for no passphrase): [输入密码]
Enter same passphrase again: [再次输入密码]
cat ~/.ssh/<key_name>.pub
Title : 为新密钥添加描述性标签 Key : 粘贴COPY的公钥内容
cd ~/.ssh
# 设置访问权限
chmod 600 <key_name>
# 生成SSH配置文件
cat > config << EOF
Host github.com
Hostname ssh.github.com
Port 443
IdentityFile ~/.ssh/<key_name>
UpdateHostKeys yes
Compression yes
User git
EOF
ssh -T [email protected]
...
Are you sure you want to continue connecting (yes/no)? <yes>
...
Hi <username>! You've successfully authenticated, but GitHub does not provide shell access.
如果找不到软件,直接下载安装 或 更换软件源 Linux 版本库管理
# 查看代理
git config --global --get http.proxy
git config --global --get https.proxy
# 设置代理
git config --global http.proxy http://[username:passwrod@]ip or URL:port
git config --global https.proxy http://[username:passwrod@]ip or URL:port
# 取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
# 只代理github.com
git config --global --get http.https://github.com.proxy
git config --global --get https.https://github.com.proxy
git config --global http.https://github.com.proxy http://[username:passwrod@]ip or URL:port
git config --global https.https://github.com.proxy http://[username:passwrod@]ip or URL:port
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy
# push设置
git config --global push.default simple
git clone https://[email protected]/xxxx/xxxx.git
# or
git clone [email protected]:xxxxx/xxxxx.git
# 克隆指定分支,到指定目录
git clone -b branch-name repo path
git config user.name "Your Name"
git config user.email [email protected]
先在githubh上创建好项目