重学git

2022-01-01  本文已影响0人  Terry_Qian

1 前言

2 常用命令

3 特殊场景

git checkout --orphan develop-tmp
# 备份仓库 -> 删除仓库 -> 重新新建一个同名仓库
git add .
git commit -am 'init'
git push origin -u develop-tmp
git push --mirror https://xxxxx/newRepository.git

4 SSH密钥配置(拓展)

错误: remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead.

使用github push tag的时候产生的报错,解决方案是使用ssh密钥配置,并且连接github时ssh密钥相比http有显著的速度提升。

-t:指定密钥的type

rsa:一种非对称加密算法

-b:指定密钥的bits长度为4096位

-C:指定密钥的Comment注释


参考:

https://blog.csdn.net/qq_15957557/article/details/107022959

https://cloud.tencent.com/developer/article/1861466

上一篇 下一篇

猜你喜欢

热点阅读