git登陆

git登陆

 

1. 执行登陆用户名和密码命令

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

2. 生产密钥对

$ ssh-keygen -t rsa -C "your_email@youremail.com"

3. 配置公钥私钥

  1. 登录到github:

 然后将 .ssh/id_rsa.pub中的内容复制到下图中的key中,并点击Add  SSH key

4. 检测密钥对是否可以使用:

$ ssh -T git@github.com

5.  使用命令 git remote -v 查看你当前的 remote url

git remote -v

6. 连接到远程仓库

登录github。点击首页的start a project,会出来下图所示:

 填写对应的信息,并点击最后一个按钮后,会得到下图中的一个链接:

复制 ssh后面的链接,在git命令行窗口执行:

git remote add origin https://github.com/OliveKong/poster.git 

 然后就可以提交代码了

原文地址:https://www.cnblogs.com/feiquan/p/11249727.html