1 修改本地git郵箱和賬號(hào)
查看用戶名?:git config user.name
查看密碼:?git config user.password
查看郵箱:git config user.email
查看配置信息: $ git config --list??
修改用戶名
git config --global user.name "xxxx(新的用戶名)"
修改密碼git config --global user.password "xxxx(新的密碼)"
修改郵箱
git config --global user.email "xxxx@xxx.com(新的郵箱)"
移除用戶名和郵箱
git config --global --replace-all user.name"你的 git 的名稱"
git config --global --replace-all uesr.email"你的 git 的郵箱"
2 修改本地密碼(此操作是克隆項(xiàng)目時(shí)賬號(hào)密碼錯(cuò)誤使用稀蟋,可以在克隆報(bào)錯(cuò)時(shí)自動(dòng)提示鍵入密碼)
gitconfig--system--unsetcredential.helper
設(shè)置記住密碼(默認(rèn)15分鐘):
git config --global credential.helper cache
如果想自己設(shè)置時(shí)間,可以這樣做:
git config credential.helper 'cache --timeout=3600'
這樣就設(shè)置一個(gè)小時(shí)之后失效
長(zhǎng)期存儲(chǔ)密碼:
git config --global credential.helper store
增加遠(yuǎn)程地址的時(shí)候帶上密碼也是可以的。(推薦)
從倉(cāng)庫(kù)的config的里面修改url,后面加上密碼
http://yourname:password@git.oschina.net/name/project.git
補(bǔ)充:使用客戶端也可以存儲(chǔ)密碼的。