Git笔记
GPG&SSH
###命令
生成gpg秘钥:
1 | gpg --full-generate-key |
获取当前的私钥列表:
1 | gpg --list-secret-keys --keyid-format=long |
导出公钥(直接使用生成秘钥时返回的公钥id):
1 | gpg --armor --export {id} |
生成ssh秘钥:
1 | ssh-keygen -t ed25519 -C {noreply-email} |
Git
###命令
快速设置:
1 | git config --global user.name {} |
clone单分支:
1 | git clone -branch {name} --single-branch {repo} {dir} |
pull并rebase提交:
1 | git pull --rebase |
检出分支(example):
1 | git checkout main |
###加速git-bash
使用反代
首先启动s302本地反代或watt toolkit的,启用github加速git全局设置(
git config --global --edit
)添加:1
2
3
4
5#此处`https`可换为`http`
[https]
proxy=https://127.0.0.1/
sslBackend = schannel #使用系统证书服务
sslVerify=true #默认为true,如果git无法使用系统证书才应禁用该项使用镜像
使用
git remote set-url origin https://kkgithub.com/{username}/{repo}
替换本地repo远程地址即可,kkgithub会自动转发镜像也可以用来辅助clone大仓库,完事了再改回origin即可
Github
PR Review
不注意其实每个pr的review选项卡的每一个修改文件都是需要手动点击Review
的(
所以喜提YOLO徽章(合并未经审核的PR)
匿名提交
本地commit可以用虚拟个人信息,只要你传得上repo
如果用的是组织账号,更甚