Git 學習之安裝配置

莫名私下裡發表於2019-12-26

**以下記錄均使用 Mac (Window系統安裝請點選或自行百度Google)
git官網地址
選用自己需要安裝的版本
下載地址
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

相關文章