Git Bash
- 创建ssh密钥
$ ssh-keygen -t rsa -C "youremail@youremail.com"
$ Generating public/private rsa key pair...
# 三次回车即可生成 ssh key
- 查看生成密钥的公钥内容
$ cat ~/.ssh/id_rsa.pub
- 测试ssh链接
$ ssh -T git@gitee.com
Gitee使用:
- 本地创建一个文件夹,将远程仓库克隆到本地仓库
$ cd D:/xxxx(文件地址) 或 在创建的文件夹下打开Git Bash
$ git clone https://gitee.com/yourname/xxxx(代码库名字)
- 本地创建一个文件夹,Git初始化本地项目,再绑定远程仓库
$ cd D:/xxxx(文件地址) 或 在创建的文件夹下打开Git Bash
$ git init
$ git remote add origin <远程仓库地址>
- 本地仓库新建文件或修改文件,提交到远程仓库
$ git add 当前文件名 (跟踪当前文件)或 $ git add .(跟踪当前路径下的所有文件,提交速度慢)
$ git commit -m “备注信息” (提交所有更新过的文件到git仓库)
$ git push origin master
- 远程仓库同步到本地仓库
$ cd D:/xxxx(文件地址) 或 在创建的文件夹下打开Git Bash
$ git pull origin master