码迷,mamicode.com
首页 > 其他好文 > 详细

玩转Git三剑客——02. 安装Git、03. 使用Git之前需要做的最小配置

时间:2019-01-12 22:53:35      阅读:266      评论:0      收藏:0      [点我收藏+]

标签:清除   视频   工作   img   .com   name   conf   com   时间   

技术分享图片

学习视频:玩转Git三剑客(苏玲 携程代码平台负责人)——极客时间 https://time.geekbang.org

一、安装 

1. 打开Git中文官网:https://git-scm.com/book/zh/v2

2. 选择“1.5 起步 - 安装Git”,选择相应的系统版本,下载安装包并根据说明进行安装

3. 验证Git安装成功:打开终端,输入“git --version”

注:视频讲解为“在Mac上安装”

二、最小配置

1. 配置user信息(必须,不配置的话,最后Git做变更提交时会出现提示信息,提示需要做相关配置)

  • git config [--local | --global | --system] user.name ‘your_name‘
  • git config [--local | --global | --system] user.email ‘your_email@domain.com‘

作用域区别:

  • local:只对用户当前工作仓库有效(缺省值)
  • global:对当前用户所有仓库有效(常用
  • system:对系统所有登录的用户有效(不常用)

注:优先级为local > global > system

2. 显示config的配置

git config --list [--local | --global | --system]

3. 清除unset

git config --unset [--local | --global | --system] user.name

玩转Git三剑客——02. 安装Git、03. 使用Git之前需要做的最小配置

标签:清除   视频   工作   img   .com   name   conf   com   时间   

原文地址:https://www.cnblogs.com/hg-love-dfc/p/10261058.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!