- 查看用户名与邮箱
$ git config --global user.name "YourName"
$ git config --global user.email "email@mail.com"
- 查看是否否已经生成过ssh-key 有会显示
$ cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAJNWaKdnPytH6TSqgkrNjxOlaJzNXhLKW3Vwh/SSPV3MVXfB9aBhS5aDjCDPBctd6Y/EgUy/vbZRVJOUvWihOZlghNX0wikX8aVkvo/3viUy90pFPHyQ6syTiNKluDsiBN8JRZyU9g493WpY4JT13O8j5ekMD4CN+BgEVd++ZsRLRVtotqAyUKLOotdWa/u4NcWV9z28qW1k52PNCBeWJ7/5WRujISAyxQt/M/oY3Hm2QQV2j9BW3m38AvjHUvqRnoFRe0eBAnPGX1mn2GZcmFa1p4+YEqApBuwwBUpQn0Bfx6CSTxI0HwvFOK3nUuKLzAPGl29dw4hUp9TKf5uYB1 huangrongyao@foreverider.com
- 如果没有就新建ssh-key
$ ssh-keygen -t rsa -C "email@mail.com"
- 断开与远程仓库的连接
$ git remote rm origin
- 将自己的ssh-key添加到远程仓库的ssh-key里
- 使用ssh链接重新连接远程仓库
$ git remote add origin <你的项目地址> //注:项目地址形式为ssh形式
git 如何在A分支merge B分支的单个文件
git checkout -p B file.txt