mac环境下,git安装和使用

时间:2019-06-23 14:16:26   收藏:0   阅读:1256

1. 在官网下载git

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

选择对应的版本,安装即可

  技术图片

 

查看git版本:git --version

  技术图片

 

 2. 通过homebrew安装git

  安装homebrew;

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  homebrew安装完成以后检查一下:brew -v

  技术图片

  

  通过brew来安装git

brew install git

 安装完成以后即可使用git --version来查看版本

  

 

示例:使用git从网上将一个项目拖到本地

  1. 创建一个文件夹,取名为project
  2. 使用命令进入到该文件夹
  3. 使用命令下载远程的项目,git clone 项目路径,这里的项目地址
git clone https://github.com/Rainno/vue-es6-webPack.git

  

  技术图片

 

然后,在创建的文件夹中即可看到下载的项目

   技术图片

到这里,git就安装好了

  

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!