编程随笔 编程随笔
  • 前端
  • 后端
  • 嵌入式
  • 星球项目
  • 开源项目
  • 海康AGV
  • 四向车
  • 工具类
  • 项目仓库

    • 部署仓库 (opens new window)
    • 代码仓库 (opens new window)
  • vuepress插件

    • 自动生成导航栏与侧边栏 (opens new window)
    • 评论系统 (opens new window)
    • 全文搜索 (opens new window)
    • 选项卡 (opens new window)
    • 自动生成sitemap (opens new window)
  • 自主开发插件

    • 批量操作frontmatter (opens new window)
    • 链接美化 (opens new window)
    • 折叠代码块 (opens new window)
    • 复制代码块 (opens new window)

liyao52033

走运时,要想到倒霉,不要得意得过了头;倒霉时,要想到走运,不必垂头丧气。心态始终保持平衡,情绪始终保持稳定,此亦长寿之道
  • 前端
  • 后端
  • 嵌入式
  • 星球项目
  • 开源项目
  • 海康AGV
  • 四向车
  • 工具类
  • 项目仓库

    • 部署仓库 (opens new window)
    • 代码仓库 (opens new window)
  • vuepress插件

    • 自动生成导航栏与侧边栏 (opens new window)
    • 评论系统 (opens new window)
    • 全文搜索 (opens new window)
    • 选项卡 (opens new window)
    • 自动生成sitemap (opens new window)
  • 自主开发插件

    • 批量操作frontmatter (opens new window)
    • 链接美化 (opens new window)
    • 折叠代码块 (opens new window)
    • 复制代码块 (opens new window)
  • 常用软件

    • vuepress-plugin-element-ui
    • pandoc使用
    • meilisearch部署
    • cloudreve部署
    • zabbix部署
    • 常用网址
    • git使用
      • git设置代理
      • 常见问题
    • 安装 acme.sh
    • 中央仓库上传指南
  • 工具类
  • 常用软件
华总
2024-07-15
0
0
目录

git使用原创

# git设置代理

1、打开clash开启代理

2、系统设置代理

​ 网络和Internet设置 -> 代理 -> 手动设置代理

3、git设置代理

git config --global http.proxy 127.0.0.1:7890
1
git config --global https.proxy 127.0.0.1:7890
1
git config --global https.proxy socks5 127.0.0.1:7890
1
git config --global https.proxy socks5 127.0.0.1:7890
1

4、查看git代理是否设置成功

git config --global -l
1
git config --global --get http.proxy
1
git config --global --get https.proxy
1

5、git取消代理

 git config --global --unset http.proxy
 git config --global --unset https.proxy
1
2

.gitignore 新加忽略文件,发现忽略的文件还会提交。

git rm -r --cached .
git add .
git commit -m 'update .gitignore'
1
2
3

# 常见问题

# 1、vscode推送报错

The authenticity of host 'github.com (ip)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?
1
2
3

解决办法

打开 Git Bash

检查现有的 SSH 密钥:

$ ls -al ~/.ssh
1

如果您已经拥有它们,您将看到:

  • id_rsa.pub
  • id_ed25519.pub

如果没有,请生成一个(按 Enter 接受默认文件位置):

ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
1

要将密钥复制到剪贴板:

clip < ~/.ssh/id_rsa.pub
1

前往 Github/Settings/SSH 和 GPG 密钥/新 SSH 密钥上的帐户

将您的密钥粘贴在那里

接下来输入:

git remote
1

如果你看到 origin,请将其删除:

git remote remove origin
1

继续 GitHub repo 页面上提供的最后 2 个步骤...

git remote add origin git@github.com:USERNAME/REPONAME.git
git push -u origin main
1
2
#git
上次更新: 2025/03/23 15:42:56
常用网址
安装 acme.sh

← 常用网址 安装 acme.sh→

最近更新
01
jFlash使用 原创
03-24
02
中央仓库上传指南 原创
03-23
03
模板生成工具 原创
02-18
04
RTC实时时钟 原创
02-12
05
keil调试 原创
01-21
更多文章>
Copyright © 2023-2025 liyao52033  All Rights Reserved
备案号:鄂ICP备2023023964号-1    
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式