更多内容可移驾至我的独立Blog: http://www.justfbt.com/
add localhost ssh key to github
略 …
configure git
# git config --global user.name "loginusername"
# git config --global user.email "mailaddress"
test connection
# ssh git@github.com
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
clone repo
# git clone https://github.com/username/xxx.git
change authentication method to ssh
# cd your-repo-dir
# vim .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
# url = https://github.com/yourusername/xxx.git
url = git@github.com:yourusername/xxx.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
test:
change something and git push
push:
# git commit -am 'update'
# git push
done.
本文介绍如何将本地SSH密钥添加到GitHub账户,并通过SSH方式配置及使用Git进行代码仓库克隆及推送操作。主要内容包括:SSH密钥的添加、Git全局设置、SSH连接测试、HTTPS认证方式改为SSH认证方式、代码推送测试。

被折叠的 条评论
为什么被折叠?



