如何安装 Git (windows/mac/linux)

文章目录

关于 git 的介绍,请移步文章 一文带你彻底学会 Git 代码管理

本文通过实操验证在不同操作系统(windows、mac、linux)下如何正确安装 git 版本控制系统,

具体步骤如下:

Window 安装 Git

(一)下载

官网下载:Git - Downloads

根据自己电脑选择对应的版本下载

(二)安装

直接双击下载的文件进行安装即可

(三)验证

安装完成后,随便找个文件夹,右键会出现很多 git 的操作即为安装完成

或者打开 cmd

shell 复制代码
git --version

看到版本即可

Mac 安装 Git

(一)下载

官网下载:Git - Downloads

根据自己电脑选择对应的版本下载

(二)安装

直接双击下载的文件进行安装即可

(三)验证

打开 cmd

shell 复制代码
git --version

看到版本即可

Linux 安装 Git

(一)下载

无需下载

(二)安装

linux install git

git 官网提供了不同 linux 系统的安装命令,复制对应的命令然后执行即可

我这里是 centos 7,命令如下

shell 复制代码
sudo yum update -y
sudo yum install git -y

(三)验证

shell 复制代码
git --version

看到版本即可

基础配置

以下配置不是必须的,按需配置

shell 复制代码
# 配置全局用户名和邮箱,提交代码时,log 会展示
git config --global user.name fiveyoboy
git config --global user.name fiveyobou@qq.com
shell 复制代码
# 全局免密码配置:执行之后会在用户主目录下的.gitconfig文件中多加 helper = store,
# 首次需要输入密码,之后就不需要了
git config --global credential.helper store
shell 复制代码
# 支持大仓库 clone
git config --global http.postBuffer 1048576000
git config --global core.compression -1
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999

原文地址

如何安装 Git (windows/mac/linux)

相关推荐
vibecoding日记1 天前
为什么我就想要「线性历史 + Signed Commits」,GitHub 却把我当猴耍 🤬🎙️
git·编程工具
程序员小崔日记1 天前
如何将代码轻松上传到 Gitee?Git 使用全攻略!
git·gitee·上传
Bigger2 天前
为什么你的 Git 提交需要签名?—— Git Commit Signing 完全指南
git·开源·github
DianSan_ERP3 天前
电商API接口全链路监控:构建坚不可摧的线上运维防线
大数据·运维·网络·人工智能·git·servlet
红豆子不相思3 天前
Tomcat 环境搭建与集群实战
服务器·git·tomcat
杰哥技术分享3 天前
Git 仓库迁移技术文档:从 CODING.net 迁移至腾讯云 CNB
git
梅孔立3 天前
Ansible 100 台服务器一键管控实战 进阶版
服务器·git·ansible
qq_426003964 天前
git切换当前分支到远程分支
git
ON10N4 天前
100% 纯 Vibe Coding,我是怎么用 AI 撸出一个 VS Code 插件的
git·ai编程·visual studio code