條件:安裝好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