git config
生效順序:3 -> 2 -> 1
- 對(duì)系統(tǒng)上所有用戶(hù)及他們所擁有的倉(cāng)庫(kù)都生效 -> /etc/gitconfig
git config --system xxx
Git 會(huì)讀寫(xiě)這個(gè)文件。
- 每個(gè)用戶(hù)的~/.gitconfig文件
git config --global xxx
- 各個(gè)庫(kù)中 Git 目錄下的配置文件(.git/config)
git config xxx
設(shè)置git分支的跟蹤關(guān)系
1蚊逢、新建一個(gè)分支時(shí)設(shè)置跟蹤關(guān)系
git checkout -b new_branch_name [--track] origin/remote_branch_name
--track選項(xiàng)可以省略
2层扶、設(shè)置已有分支和遠(yuǎn)端分支的跟蹤關(guān)系
git branch -u origin/remote_branch_name local_branch_name
注意:-u選項(xiàng)是--set-upstream-to的簡(jiǎn)寫(xiě),因此上面這條命令可以寫(xiě)作
git branch --set-upstream-to=origin/remote_branch_name local_branch_name
local_branch_name可以省略烙荷,默認(rèn)值為當(dāng)前分支
多個(gè)git ssh key 問(wèn)題
http://www.reibang.com/p/f7f4142a1556
參考文章
https://sandwind.gitbooks.io/git-pro-cn/content/git-base/get.html
本地git config配置和git基本操作