git的各种安装指南
bashsudo apt update
bashsudo apt install git
bashgit --version
bashgit config --global user.name "Your Name"
git config --global user.email "you@example.com"
bashsudo yum update
bashsudo yum install git
bashsudo yum install epel-release sudo yum install git
bashgit --version
bashgit config --global user.name "Your Name"
git config --global user.email "you@example.com"
下载Git for Windows: 访问Git官网下载适用于Windows的Git安装程序。
运行安装程序: 下载完成后,双击运行安装程序。按照安装向导的提示进行操作。你可以选择默认设置,或者根据需要自定义安装路径和其他选项。
选择安装路径:
在“Select Destination Location”页面,默认路径通常是C:\Program Files\Git
,你可以根据需要更改安装路径。
选择组件: 在“Select Components”页面,你可以选择安装哪些组件。默认设置通常已经足够,但你可以根据需求进行调整。例如,可以勾选“On the Desktop”以便在桌面上创建快捷方式。
选择开始菜单文件夹: 在“Choose Start Menu Folder”页面,选择一个文件夹来放置Git的快捷方式。默认设置通常已经合适。
选择默认编辑器: 在“Choose the default editor used by Git”页面,选择你希望用作Git默认文本编辑器的工具。常见的选择包括Vim、VS Code等。如果你没有特别偏好,可以选择默认的Vim或Notepad++。
调整环境变量: 在“Adjusting your PATH environment”页面,选择如何将Git添加到系统的PATH环境变量中:
选择HTTPS传输后端: 在“Choosing the SSH executable”页面,选择SSH客户端。通常情况下,默认选项“Use OpenSSH”是合适的。
配置行尾转换: 在“Configuring the line ending conversions”页面,选择如何处理行尾字符(Line Endings):
完成安装: 安装完成后,可以在开始菜单中找到“Git Bash”或“Git CMD”,这些是Git在Windows上的命令行工具。
验证安装: 打开Git Bash或Git CMD窗口,并输入以下命令以验证Git是否安装成功,并查看其版本号:
bashgit --version
bashgit config --global user.name "Your Name"
git config --global user.email "you@example.com"
bashgit config --list
注
文章如有错误,还望留言指正
参考资料 来自ai生成