git最小配置
配置user信息
配置user.name和user.email
$git config --global user.name 'your_name'
$git config --global user.email 'your_email@domain.com'
config的三个作用域
缺省等同于local
$git config --local:local支队某个仓库有效
$git config --global:global对当前用户所有仓库有效
$git config --system:system对系统所有登录的用户有效(基本不用)
显示config的配置,加--list
$git config --list --local
$git config --list --global
$git config --list --system
local优先级高于global!
建Git仓库
两种场景:
1.把已有的项目代码纳入Git管理
$cd 项目代码所在的文件夹
$git init
2.新建的项目直接用Git管理
$cd 某个文件夹
$git init your_project #会在当前路径下创建和项目名称同名的文件夹
$cd your_project