$ git config --global user.name "defnngj" //給自己起個(gè)用戶名
$ git config --global user.email "defnngj@gmail.com" //填寫自己的郵箱
克隆工程
git clone ssh://user:pssword@url
其中user是你的賬號(hào)
password是你的密碼
url是遠(yuǎn)程git庫地址
Matching
‘matching’ 參數(shù)是 Git 1.x 的默認(rèn)行為,其意是如果你執(zhí)行 git push 但沒有指定分支撤缴,它將 push 所有你本地的分支到遠(yuǎn)程倉庫中對(duì)應(yīng)匹配的分支捐顷。
Simple
而 Git 2.x 默認(rèn)的是 simple,意味著執(zhí)行 git push 沒有指定分支時(shí)狸膏,只有當(dāng)前分支會(huì)被 push 到你使用 git pull 獲取的代碼沟饥。
修改默認(rèn)設(shè)置
從上述消息提示中的解釋,我們可以修改全局配置湾戳,使之不會(huì)每次 push 的時(shí)候都進(jìn)行提示贤旷。對(duì)于 matching 輸入如下命令即可:
git config --global push.default matching
而對(duì)于 simple ,請(qǐng)輸入:
git config --global push.default simple