【git】win 10 / win 11:git 下载、安装

目录

一、git 下载

二、git 安装

(1)继续之前,请阅读以下重要信息

(2)自定义选择安装位置

(3)选择组件

(4)创建开始菜单目录

(5)选择 Git 使用的默认编辑器

(6)调整新存储库中初始分支的名称(新版  2.37.2.2 多此环节)

(7)选择 HTTPS 传输后端(新版  2.37.2.2 与下一环节顺序颠倒)

(8)配置 PATH 环境(新版  2.37.2.2 与上一环节顺序颠倒)

(9)选择 SSH 可执行文件(新版  2.37.2.2 多此环节)

(10)配置行结束转换

(11)配置终端模拟器以与 Git Bash 一起使用

(12)选择默认的行为 ‘git pull’(新版  2.37.2.2 多此环节)

(13)选择凭据助手(新版  2.37.2.2 多此环节)

(14)配置额外的选项

(15)配置实验选项(新版  2.37.2.2 多此环节)

(16)安装完成

(17)验证安装成功



一、git 下载

git 官网下载地址:https://git-scm.com

 



二、git 安装

安装步骤:

1.安装 git 时,要选择自定义安装路径

2.勾选生成 git 的桌面快捷方式

3.其他全部默认选项安装

4.验证安装成功


(1)继续之前,请阅读以下重要信息


(2)自定义选择安装位置


(3)选择组件

中文译文:
1.Additional icons:附加图标
​   On the Desktop:在桌面上

2.Windows Explorer integration Windows:资源管理器集成鼠标右键菜单
​    Git Bash Here:命令行窗口
​    Git GUI Here:可视化窗口

3.Git LFS (Large File Support):大文件支持

4.Associate .git* configuration files with the default text editor:
将 .git 配置文件与默认文本编辑器相关联

5.Associate .sh files to be run with Bash:
将 .sh 文件关联到 Bash 运行

6.Use a TrueType font in all console windows:
在所有控制台窗口中使用 TrueType 字体

7.Check daily for Git for Windows updates:
每天检查 Git 是否有 Windows 更新


(4)创建开始菜单目录


(5)选择 Git 使用的默认编辑器

中文译文:
1.Use the Nano editor by default
默认使用 Nano 编辑器

2.Use Vim (The ubiquitous text editor) as Git's default editor
使用 Vim 作为 Git 的默认编辑器

3.Use Notepad++ as Git's default editor
使用 Notepad++ 作为 Git 的默认编辑器

4.Use Visual Studio Code as Git's default editor
使用 Visual Studio Code 作为 Git 的默认编辑器


(6)调整新存储库中初始分支的名称(新版  2.37.2.2 多此环节

中文译文:

1.Let Git decide:默认 Git 配置
Let Git use its default branch name (currently: "master") for the initial branchin newly created repositories. The Git project intends to change this default toa more inclusive name in the near future.

让 Git 使用它的默认分支名称 (当前:“master”) 作为初始分支新创建的存储库。Git 项目打算在不久的将来将此默认名称更改为更具包容性的名称。

2.Override the default branch name for new repositories:重写新存储库的默认分支名称
NEW! Many teams already renamed their default branches; common choices are"main", "trunk" and "development". Specify the name "git init" should use for theinitial branch:

新的!许多团队已经重新命名了它们的默认分支;常见的选择是 “main”、“trunk” 和“development”。指定初始分支应该使用的名称 “git init”
This setting does not affect existing repositories:此设置不影响现有存储库。


(7)选择 HTTPS 传输后端(新版  2.37.2.2 与下一环节顺序颠倒

中文译文:
1.Use the OpenSSL library:使用 OpenSSL 库

Server certificates will be validated using the ca-bundle.crt file.
服务器证书将使用 ca-bundle.crt 文件进行验证。

2.Use the native Windows Secure Channel library:使用本地 Windows 安全通道库

Server certificates will be validated using Windows Certificate Stores.This option also allows you to use your company's internal Root CA certificates distributed e.g. via Active Directory Domain Services.
服务器证书将使用 Windows 证书存储验证。此选项还允许您使用公司的内部根 CA 证书,例如,通过 Active Directory Domain Services 。


(8)配置 PATH 环境(新版  2.37.2.2 与上一环节顺序颠倒

中文译文:
1.Use Git from Git Bash only:仅使用 git 命令行窗口
This is the safest choice as your PATH will not be modified at all.You will only be able to use the Git command line tools form Git Bash.
这是最安全的选择,因为您的 PATH 根本不会被修改。您只能使用 Git Bash 的 Git 命令行工具。

2.Use Git from the Windows Command Prompt:使用来自命令行和第三方软件的 git
This option is considered safe as it only adds some minimal Git wrappers to your PATH to avoid cluttering your environment with optional Unix tools . You will be able to use Git from both Git Bash and the Windows Command Prompt.
这个选项被认为是安全的,因为它只向 PATH 添加一些最小的 Git 包,以避免使用可选的Unix 工具混淆环境。 您将能够从 Git Bash 和 Windows 命令提示符中使用 Git。

3.Use Git and optional Unix tools from the Windows Command Prompt:从 Windows 命令提示符使用 Git 和可选的 Unix 工具

Both Git and the optional Unix tools will be added to you PATH.

Git 和可选的 Unix 工具都将添加到您计算机的 PATH 中。

Warning:This will override Windows tools like "find and sort".Only use this option if you understand the implications.
警告:这将覆盖 Windows 工具,如 “ find 和 sort  ”。只有在了解其含义后才使用此选项。


(9)选择 SSH 可执行文件新版  2.37.2.2 多此环节

中文译文:

1.Use bundled OpenSSH:使用捆绑 OpenSSH
This uses ssh.exe that comes with Git.

它使用 Git 附带的 ssh.exe 。

2.Use external OpenSSH:使用外部 OpenSSH
NEW! This uses an external ssh.exe. Git will not install its own OpenSSH(and related) binaries but use them as found on the PATH.

新的!这使用外部 ssh.exe 。GIT 不会安装它自己的 OpenSSH (和相关的)二进制文件,而是按照路径上找到的那样使用它们。


(10)配置行结束转换

中文译文:
1.Checkout Windows-style,commit Unix-style line endings:签出 Windows 样式,提交 Unix 样式的行尾
Git will convert LF to CRLF when checking out text files.When committing text files,CRLF will be converted to LF .For cross-pltform projects,this is the recommended setting on Windows ("core.autocrlf" is set to "true")
在检出文本文件时,Git 会将 LF 转换为 CRLF 。当提交文本文件时,CRLF 将转换为 LF 。 对于跨平台项目,这是 Windows 上推荐的设置( “core.autocrlf” 设置为 “true” )

2.Checkout as-is , commit Unix-style line endings:按 as-is 签出,提交 unix 样式的行尾
Git will not perform any conversion when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform projects,this is the recommended setting on Unix ("core.autocrlf" is set to "input")
在检出文本文件时,Git 不会执行任何转换。 提交文本文件时,CRLF 将转换为 LF 。 对于跨平台项目,这是 Unix 上的推荐设置 ( “core.autocrlf” 设置为 “input” )

3.Checkout as-is,commit as-is:按 as-is 签出,按 as-is 提交
Git will not perform any conversions when checking out or committing text files.Choosing this option is not recommended for cross-platform projects ("core.autocrlf"is set to "false")
在检出或提交文本文件时,Git 不会执行任何转换。对于跨平台项目,不推荐使用此选项( “core.autocrlf” 设置为 “false” )


(11)配置终端模拟器以与 Git Bash 一起使用

中文译文:
1.Use MinTTY (the default terminal of MSYS2):使用 MinTTY ( MSYS 2 的默认终端)
Git Bash will use MinTTY as terminal emulator,which sports a resizable window,non-rectangular selections and a Unicode font. Windows console programs (such as interactive Python) must be launched via 'winpty' to work in MinTTY.
Git Bash 将使用 MinTTY 作为终端模拟器,该模拟器具有可调整大小的窗口,非矩形选区和 Unicode 字体。 Windows 控制台程序(如交互式 Python )必须通过 'winpty' 启动才能在MinTTY 中运行。

2.Use Windows' default console window:使用 Windows 的默认控制台窗口
Git will use the default console window of Windows ("cmd.exe"),which works well with Win32 console programs such as interactive Python or node.js , but has a very limited default scroll-back,needs to be configured to use aUnicode font in order to display non-ASCII characters correctly,and prior to Windows 10 its windows was not freely resizable and it only allowed rectangular text selections.
Git 将使用 Windows 的默认控制台窗口(“cmd.exe”),该窗口可以与 Win32 控制台程序(如交互式 Python 或 node.js )一起使用,但默认的回滚非常有限,需要配置为使用 unicode 字体以正确显示非 ASCII 字符,并且在 Windows 10 之前,其窗口不能自由调整大小,并且只允许矩形文本选择。


(12)选择默认的行为 ‘git pull’新版  2.37.2.2 多此环节

中文译文:

1.Default (fast-forward or merge) :默认(快速转发或合并)
This is the standard behavior of 'git pull ': fast-forward the current branch tothe fetched branch when possible, otherwise create a merge commit.

这是 “git pull” 的标准行为:如果可能的话,将当前分支快速转发到获取的分支,否则将创建合并提交。


2.Rebase:重基
Rebase the current branch onto the fetched branch. If there are no localcommits to rebase, this is equivalent to a fast-forward.

将当前分支重新定位到获取的分支上。如果没有要重基的本地提交,这相当于快速转发。


3.only ever fast-forward:只有永远快进
Fast-forward to the fetched branch. Fail if that is not possible.

快进到抓取的树枝上。如果这是不可能的,那就失败。


(13)选择凭据助手新版  2.37.2.2 多此环节

中文译文:

1.Git Credential Manager:GIT 凭证管理
Use the cross-platform Git Credential Manager.

使用跨平台 Git 凭据管理器。
See more information about the future of Git Credential Manager here.

请参阅有关 Git 凭据经理未来的更多信息。


2.None:无
Do not use a credential helper.

不要使用凭据助手。


(14)配置额外的选项

中文译文:
1.Enable file system caching:启用文件系统缓存

File system data will be read in bulk and cached in memory for certain operations ("core.fscache" is set to "true"). This provides a significant performance boost.
文件系统数据将被批量读取并缓存在内存中用于某些操作( “core.fscache” 设置为 “true”)。 这提供了显着的性能提升。

2.Enable Git Credential Manager:启用 Git 凭证管理器(新版无此选项)

The Git Credential Manager for Windows provides secure Git credential storage for Windows,most notably multi-factor authentication support for Visual Studio Team Services and GitHub. (requires .NET framework v4.5.1 or or later).
Windows 的 Git 凭证管理器为 Windows 提供安全的 Git 凭证存储,最显着的是对 Visual Studio Team Services 和 GitHub 的多因素身份验证支持。 (需要 .NET Framework v4.5.1 或更高版本)。

3.Enable symbolic links:启用符号链接

Enable symbolic links (requires the SeCreateSymbolicLink permission).Please note that existing repositories are unaffected by this setting.
启用符号链接(需要 SeCreateSymbolicLink 权限)。请注意,现有存储库不受此设置的影响。


(15)配置实验选项新版  2.37.2.2 多此环节

中文译文:

1.Enable experimental support for pseudo consoles:启用对伪控制台的实验支持
(NEW!) This allows running native console programs like Node or Python in aGit Bash window without using winpty, but it still has known bugs.

(新的!)这允许在 aGit Bash 窗口中运行本地控制台程序,如 Node 或 Python,而无需使用winpty,但它仍然存在已知的 bug 。


2.Enable experimental built-in file system monitor:启用实验性内置文件系统监视器
(NEW!)Automatically run a built-in file system watcher, to speed up commonoperations such as `git status`, 'git add, 'git commit', etc in worktreescontaining many files.

(新!)自动运行内置的文件系统监视程序,以加快包含多个文件的工作树中的公共操作,如“git status”、“git add”、“git COMMIT” 等。


(16)安装完成


(17)验证安装成功

Bash 命令行窗口输入以下命令查看 git 命令集和 git 版本号:

git
git --version

  • 8
    点赞
  • 28
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

顾三殇

觉得不错的话,打赏鼓励一下吧~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值