1.首先确定你已经在mac中配了密匙。
(1) cd ~
(2)ls -a
查看是否存在 *** 和 ***.pub文件 或者 .ssh文件夹
如果不需要 直接删除 rm *** ***.pub rm -rf .ssh 如有需要备份 将其copy一份
2.生成ssh密匙
ssh-keygen -t rsa -C "用户名"
之后按三次回车
具体:
Enter file in which to save the key (/Users/diaosi/.ssh/id_rsa): 按第一次回车
Enter passphrase (empty for no passphrase): 按第二次回车
Enter same passphrase again: 按第三次回车
3.查看密匙并将其内容加入到github的SSH密匙中
cd ~/.ssh
ls 后 会发现有个id_rsa.pub文件
cat id_rsa.pub
将里面的信息复制
打开github.com 输入账号 密码 在右上角的位置 Accounting Settings
弹出一个界面 在左侧发现 ssh-key
点击将复制的内容复制进去
4.设置个人信息
git config --global user.name "这个填写github的用户名"
git config --global user.email 邮箱
5.开始第一次的创建项目之旅
github使用过程
1.先从网站上新建一个项目
2.git clone git地址
3.git add 加入需要更新的文件
4.git commit -m “解释”
5.git push -u origin master