本文章僅是個人對 git 網路資源的整理筆記,若有侵權請告知 email : [email protected] 會盡快處理
https://github.com/twtrubiks/Git-Tutorials
Git 教學 - Git 書 - 為你自己學 Git | 高見龍
以及所有內文中的連結
# set your own info
git config --global user.name "DennisLiu16"
git config --global user.email "[email protected]"
# check info
git config --global user.name # return DennisLiu16
git config --global user.email # return [email protected]
git config --list
延伸閱讀
git init
在做什麼?
建立 .git
(dir)
在資料夾內 e.g. /home/tmp
使用命令 git init
會建立一個 git repo (repository) 並預設於資料夾內產生 .git
, 不論該資料夾中是否已有文件(工作目錄)都能執行,而大部分的 git 命令需要 git init
後才能使用 e.g. git status
,因為 Git 命令牽涉 .git
資料夾的操作
.git
tree structure
# tree -L 2 -I *.sample
.git
├── branches
├── config
├── description
├── HEAD
├── hooks
├── info
│ └── exclude
├── objects
│ ├── info
│ └── pack
└── refs
├── heads
└── tags
自訂 .git
產生的位置
可以設置參數 $GIT_DIR
指定 Git configuration files 存放的路徑,這種的應用例子會出現在需要對隱藏的設定文件 (dotfiles) e.g. .bashrc
進行版本管理時,將 .git
dir 放置於特定資料夾便於管理
Git 初始化的優勢
相比SVN集中式的管理,Git 的使用者不需要對目標資料夾進行任何文檔的修改、引用,對於伺服器也沒有需求(SVN需要備份伺服器),只需要 git init
即可完成