使用GitHub创建项目并下载到本地(目的:使用GitHub作为版本管理工具)

创建成功后在mac os系统终端运行
ssh-keygen
生成ssh key,然后运行pbcopy < ~/.ssh/id_rsa.pub
拷贝ssh key,然后去到GitHub上,找到settings,点击后打开设置,找到SSH and GPG keys选项,点击,

打开右上角New SSH Key,输入title,将拷贝的内容粘贴到key中

点击Add SSH Key即可
接下来去刚刚创建的项目中拷贝git链接,如:

然后再mac终端进入一个空文件夹,运行git clone (git拷贝地址)
拷贝完成和,进入代码目录,运行如下命令修改当前 git 的用户名和邮箱,改成和当前 github 用户名和注册邮箱一致
cd 目录
git config user.name '用户名'
git config user.email '邮箱'
随便修改README.md文件,提交后查看是否成功
git add .
git commit -m "日志信息"
git push origin master
网友评论