Git 使用日志

76 阅读1分钟
title: Git 使用日志
date: 2023-11-08
updated:  2023-11-08
tags: shell
categories: Git

SSH 传输

问题

git ·push 时出现问题

 fatal:Authentication failed for‘https://git ...

原因/解决:

github 政策改变,在填写 password 时要使用 token

docs.github.com/en/get-star…

docs.github.com/en/authenti…

image-20231108223535267

优化

但是使用 https 协议每次都要输入 token

改为 ssh 传输

参考

blog.csdn.net/qq_41726670…

查看现在使用什么协议传输

 git remote -v
 origin  https://github.com/用户名/仓库 (fetch)
 origin  https://github.com/用户名/仓库 (push)
 ​

可以看出来使用了 https 协议

修改为 ssh 传输(前提事先生成 ssh 密钥)

 git remote set-url origin git@github.com:用户名/仓库  
 ​