1. 取消本地所有add操作
2.取消本地add的某个文件
3.删除本地无效远程分支
4. 打tag
| 12
 
 | git tag tagnamegit push origin tagname
 
 | 
5.获取远程分支
6. 复制其他分支的提交
| 1
 | git cherry-pick <commit id>
 | 
7. 恢复删除的分支
| 12
 3
 4
 
 | # 查看历史git log只能查看当前分支log, reflog可以查看所有的分支包括删除的git reflog
 # 被删除分支的commit_id
 git branch <branch_name> <commit_id>
 
 | 
8. 多个本地ssh密钥
1.生成多个ssh密钥
| 12
 3
 4
 5
 6
 
 | # 码云ssh-keygen -t rsa -C '邮箱' -f ~/.ssh/gitee_id_rsa
 # github
 ssh-keygen -t rsa -C '邮箱' -f ~/.ssh/github_id_rsa
 # 云效
 ssh-keygen -t rsa -C '邮箱' -f ~/.ssh/thoughts_id_rsa
 
 | 
2.在 ~/.ssh 目录下新建一个config文件,无扩展名
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 
 | # window在用户目录下,linux在/登录用户/.ssh 。 都是隐藏文件夹# gitee
 Host gitee.com
 HostName gitee.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/gitee_id_rsa
 # github
 Host github.com
 HostName github.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/github_id_rsa
 # 云效
 Host codeup.aliyun.com
 HostName codeup.aliyun.com
 PreferredAuthentications publickey
 IdentityFile ~/.ssh/thoughts_id_rsa
 
 | 
3.测试
| 12
 3
 4
 
 | # 测试前确保已上传了公钥到代码托管平台ssh -T git@gitee.com
 ssh -T github.com
 ssh -T codeup.aliyun.com
 
 |