#### 用戶信息
當安裝完 Git 應該做的第一件事就是設置你的用戶名稱與郵件地址。 這樣做很重要,因為每一個 Git 的提交都會使用這些信息,并且它會寫入到你的每一次提交中,不可更改:
~~~
$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com
~~~
如果使用了 `--global` 選項,那么該命令只需要運行一次,因為之后無論你在該系統上做任何事情,` Git` 都會使用那些信息。 當你想針對特定項目使用不同的用戶名稱與郵件地址時,可以在那個項目目錄下運行沒有 `--global` 選項的命令來配置。
#### 檢查配置信息
如果想要檢查你的配置,可以使用 `git config --list` 命令來列出所有 Git 當時能找到的配置。
~~~
Administrator@PC-20171024GNST MINGW32 /d/phpStudy/WWW/workspace/DragonApp (maste r)
$ git config --list
core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/ssl/certs/ca-bundle.crt
diff.astextplain.textconv=astextplain
rebase.autosquash=true
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.required=true
filter.lfs.process=git-lfs filter-process
credential.helper=manager
user.name=Amammatthew
user.email=amamatthew@sina.cn
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
core.symlinks=false
core.ignorecase=true
remote.origin.url=https://gitee.com/amamatthew/Extjs6.2-Dragon.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
~~~
你可能會看到重復的變量名,因為 Git 會從不同的文件中讀取同一個配置(例如:`/etc/gitconfig` 與 `~/.gitconfig`)。 這種情況下,Git 會使用它找到的每一個變量的最后一個配置。
你可以通過輸入 `git config <key>`: 來檢查 Git 的某一項配置
~~~
$ git config user.name
John Doe
~~~
#### 獲取幫助
若你使用 Git 時需要獲取幫助,有三種方法可以找到 Git 命令的使用手冊:
~~~
$ git help <verb>
$ git <verb> --help
$ man git-<verb>
~~~
例如,要想獲得 config 命令的手冊,執行
~~~
$ git help config
~~~
這些命令很棒,因為你隨時隨地可以使用而無需聯網。 如果你覺得手冊或者本書的內容還不夠用,你可以嘗試在 `Freenode IRC` 服務器( `irc.freenode.net` )的 `#git` 或 `#github` 頻道尋求幫助。 這些頻道經常有上百人在線,他們都精通 `Git` 并且樂于助人。
- 目錄
- 撤銷
- Git reset
- Git revert
- Git reset 命令
- Git的撤消操作 - 重置, 簽出和撤消
- 沖突
- 解決Git合并分支發生的沖突
- BASH
- 復制黏貼
- 教程
- 合并
- 合并提交
- 分支
- Gitee(碼云)
- Github
- 免費私有庫
- 本地倉庫推送到github倉庫
- 工具
- SourceTree
- 添加git-bash.exe到環境變量
- Git
- 安裝
- 配置
- 命令行
- 10個技巧讓開發者的Git水平迅速提升
- 3.2 Git 分支 - 分支的新建與合并
- 遠程分支
- Git幫助
- Git幫助
- 顯示命令幫助
- Git 命令
- 參數配置
- 還原至上次提交
- Git 操作命令
- Git tag
- Git 分支管理
- 認識分支
- 賣主分支
- 分支操作
- 本地倉庫遠程提交
- Git 分區
- 認識里程碑
- 忽略文件
- 已有項目
- 《Git權威指南》