mac环境下,git安装和使用

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就安装好了

  

猜你喜欢

转载自www.cnblogs.com/tianyuanqi/p/11055410.html