git learning &3远程仓库

1.添加密钥

ref:https://www.cnblogs.com/xixihuang/p/5522424.html

①ssh-keygen -t rsa -C “enlei.gong@cienet.com.cn”

(密钥类型用-t指定,默认ssh-2,这里指定rsa;-c指定注释)

②复制公钥id_rsa.pud到剪贴板:clip <~/.ssh/id_rsa.pub

或者cat  ~/.ssh/id_rsa.pub 然后手动复制

③将ssh key添加到github

ref:https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/

④测试ssh是否成功地添加到github:ssh -T git@github.com

2.添加远程库

关联远程库:

$git remote add origin git@github.com:gongel/learngit.git

推送到远程库

$git push origin master (origin主机名,master远程端分支名)

git push常见用法

0

发表评论

邮箱地址不会被公开。 必填项已用*标注