公钥
生成公钥指令 ssh-keygen -t rsa
, 其中 -t
参数用于指定密钥的类型,默认就是 rsa 类型
生成后,通常保存在 ~/.ssh/id_rsa.pub
中
配置
1 2 3 4 5 6 7 8
| git config [--global] list
git config --global user.email "xxx"
git config --global user.name "xxx"
|
常用指令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
| git init
git add
git commit
git branch
git branch -r
git branch [branch]
git checkout -b [branch]
git delete -d [branch]
git merge [branch]
git push origin --delete [branch]
git branch -vv
git branch --set-upstream-to=origin/[branch1] [branch2]
git push -u origin [branch]
git remote remove origin
|
代理
终端设置 clash 代理
1 2 3 4 5 6 7
| // 设置 git config --global http.proxy http://127.0.0.1:7890 git config --global https.proxy https://127.0.0.1:7890
// 取消设置 git config --global --unset http.proxy git config --global --unset https.proxy
|