条件:安装好git 创建好码云私有仓库
步骤:
- 设置邮箱帐号:git config --global user.email ""123@qq.com(自己的邮箱)"
- 设置码云昵称:git config --global user.name "your name"
- 生成 sshkey:ssh-keygen -t rsa -C " 你的邮箱 "
- 查看公钥:cat ~/.ssh/id_rsa.pub
- 登录码云添加公钥
- 配置本地的git忽略文件 在git bash中 vim .gitignore (其他自行百度)
- 初始化git仓库:git init
- 链接远程仓库:git remote add origin "ssh地址"
- 把远程仓库的文件拉下来:git pull
- 添加所有文件: git add --all 或者git add .
- 添加注释: git commit -m ""yours annotation"
- 上传文件到master分支:git push -u origin master