Git 学习之安装配置
**以下记录均使用 Mac (Window系统安装请点击或自行百度Google)
git官网地址
选用自己需要安装的版本
下载地址
$ git --version // 查看是否安装成功 使用 git 也可 与 git help 等义
git version 2.20.1 (Apple Git-117)
// 简单配置用户信息命令
$ git config --global user.name "Your Name"
$ git config --global user.email "email@example.com"
local:区域为本仓库 只对本仓库有效,切换到另外一个仓库无效
global: 当前用户的所有仓库 当前用户的所有仓库有效,最常用
system: 本系统的所有用户 系统的所有用户,几乎不用
// 文件地址
// local的在.git/config里面;global的在个人home目录下的.gitconfig里面;system应该在git安装目录的下
$ git config [--local | --global | --system] user.name 'Your name'
$ git config [--local | --global | --system] user.email 'Your email'
// git config --list --global 等效 git config --global --list
// 查看配置
$ git config --list [--local | --global | --system]
credential.helper=osxkeychain
core.excludesfile=/Users/macmoming/.gitignore_global
difftool.sourcetree.cmd=opendiff "$LOCAL" "$REMOTE"
difftool.sourcetree.path=
mergetool.sourcetree.cmd=/private/var/folders/0d/ycll6pxn2xg9jj0yxmnx8hrw0000gn/T/AppTranslocation/58521717-2CE1-4DBA-968D-BDC2AFF0B6DA/d/Sourcetree.app/Contents/Resources/opendiff-w.sh "$LOCAL" "$REMOTE" -ancestor "$BASE" -merge "$MERGED"
mergetool.sourcetree.trustexitcode=true
user.name=your name
user.email=your email@163.com
commit.template=/Users/macmoming/.stCommitMsg
本作品采用《CC 协议》,转载必须注明作者和本文链接
推荐文章: