您的位置:首页 > 编程语言

github 使用总结

2014-06-07 22:51 162 查看
参考:https://help.github.com/articles/generating-ssh-keys#platform-linux

1、生成ssh key

ssh-keygen -t rsa -C "your_email@example.com"
# Creates a new ssh key, using the provided email as a label
# Generating public/private rsa key pair.
# Enter file in which to save the key (/home/you/.ssh/id_rsa):Enter passphrase (empty for no passphrase): [Type a passphrase]
# Enter same passphrase again: [Type passphrase again]


2、添加 new key 到 ssh-agent

ssh-add ~/.ssh/id_rsa


3、将pub key 上传到github

将 ~/.ssh/id_rsa.pub 中的内容粘贴到github ssh key中

4、测试连接是否正常

ssh -T git@github.com
# Attempts to ssh to github


5、同步服务器中的仓库:

$ git config
--global user.name
"your name"

$ git config
--global user.email
"your_email@youremail.com"

$ git clone git@github.com:yourname/yourRepo.git


6、提交上传:
git add README
git commit -m "first commit"
git push origin master
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: