赞
踩
记录一下mac系统安装git环境
打开终端输入git --version
git官网下载界面https://git-scm.com/download/mac
通过官网介绍我们得知安装git有下面几种方式,我们下面会通过Homebrew的方式进行安装
可参考本人写的第一篇http://t.csdn.cn/XlZ1M mac m1芯片安装Homebrew,里面有详细介绍
- #通过brew 中的search 可以查询git
- brew search git
- #通过brew 安装git
- brew install git
- #通过brew 更新git
- brew upgrade git
M1芯片ARM版Homebrew会把程序安装到/opt/homebrew/Cellar路径下
- vim ~/.zshrc
- #输入i进入编辑模式
- #添加下面这句话,版本需要进入/opt/homebrew/Cellar/git/目录下查看
- export GIT=/opt/homebrew/Cellar/git/2.39.2
- #然后按esc,在输入:wq退出编辑模式并保存
- #通过source命令更新~/.zshrc文件
- source ~/.zshrc
- #现在就可以通过git --version查看一下安装的版本了
- git config --global user.name "git账号"
- git config --global user.email "git邮箱"
- #通过git config --list来查看配置
到这里我们的git安装就结束啦!仅供大家参考
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。