惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The Register - Security
The Register - Security
T
Troy Hunt's Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
G
GRAHAM CLULEY
S
Schneier on Security
S
Secure Thoughts
Know Your Adversary
Know Your Adversary
Forbes - Security
Forbes - Security
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
The Hacker News
The Hacker News
Y
Y Combinator Blog
L
LINUX DO - 最新话题
D
Docker
S
Security @ Cisco Blogs
P
Proofpoint News Feed
V
Vulnerabilities – Threatpost
博客园_首页
T
The Blog of Author Tim Ferriss
Blog — PlanetScale
Blog — PlanetScale
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V2EX - 技术
V2EX - 技术
NISL@THU
NISL@THU
MongoDB | Blog
MongoDB | Blog
阮一峰的网络日志
阮一峰的网络日志
P
Privacy & Cybersecurity Law Blog
C
Cisco Blogs
AWS News Blog
AWS News Blog
博客园 - 司徒正美
Martin Fowler
Martin Fowler
W
WeLiveSecurity
月光博客
月光博客
博客园 - 聂微东
N
News and Events Feed by Topic
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
T
Tenable Blog
IT之家
IT之家
MyScale Blog
MyScale Blog
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 三生石上(FineUI控件)
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
B
Blog
量子位
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
N
News and Events Feed by Topic
Vercel News
Vercel News

敖苛记

甜甜圈的数学:donut.c 是如何工作的 | 敖苛记 如何让 AI Agent 工具帮助你清理 C 盘,让 C 盘不再报红? | 敖苛记 如何安装 Claude Code 并用 cc-switch 配置国内大模型 | 敖苛记 如何安装 Windows 的包管理器 scoop 并配置国内镜像 | 敖苛记 给 Deepseek 发 <think> 之后,它就串台了? | 敖苛记 如何处理 PowerShell 中文乱码问题 | 敖苛记 敖苛记 敖苛记 如何使用 ollama 和 open-webui 搭建自己的本地 AI 助手 | 敖苛记 如何使用 archinstall 安装 Arch Linux | 敖苛记 如何使用 Ventoy 制作一个便捷的 Arch Linux to go | 敖苛记
如何在 Windows 安装 Git | 敖苛记
敖苛, i@kayro.cn · 2026-05-15 · via 敖苛记

手把手教你在 Windows 上安装 Git,并完成基础初始化配置

获取安装包

官网下载 Windows 的 git 安装包,如果你的网络环境不允许你直接在这里下载,你也可以在清华源下载。

大多数人电脑是 x64 的,选择 Git for Windows/x64 Setup 或 Git-xx-64-bit.exe 即可。

开始安装

  1. 点击安装包,进入许可证界面,点击 Next。
  2. 按喜好设置安装路径后点击 Next。
  3. 按需勾选自己需要的服务:
选择组件
选择组件

这里我勾选了添加 Git Bash 到 Windows Terminal,这样就可以在 Windows Terminal 里直接打开 Git Bash 了。

  1. 询问是否添加 Git 到开始菜单,默认,点击 Next。
  2. 选择默认编辑器,按需设置,我选择了Use Visual Studio Code as Git's default editor
  3. 设置默认分支名,默认是 master,建议改为 main,和 GitHub 一致,点击 Next。
  4. 询问你想如何在命令行使用 git,默认是 Git from the command line and also from 3rd-party software,点击 Next。
  5. 设置 HTTPS 传输后端,默认是 Use the native Windows Secure Channel Library,点击 Next。
  6. 设置换行符,默认是 Checkout Windows-style, commit Unix-style line endings,点击 Next。
  7. 设置终端模拟器,默认是 Use MinTTY (the default terminal of MSYS2),它对 Git Bash 这套环境的兼容性更自然,点击 Next。
  8. 选择 git pull 的默认行为,默认是 Default (fast-forward or merge),点击 Next。
  9. 配置凭证管理器,默认是 Git Credential Helper,点击 Next。
  10. 配置额外选项,默认是 Enable file system caching,点击 Install 进行安装。
  11. 安装完成,点击 Finish。

验证安装

Win+R 输入 cmd 打开命令行,

输入 git -v,如果能看到版本信息就说明安装成功了。

初始化配置

为方便后续使用,推荐你设置全局的用户名和邮箱:

PS>

git config --global user.name "xx"

PS>

git config --global user.email xx@xx.com