下面由linux系統(tǒng)教程欄目給大家介紹Linux下git 命令 免輸密碼怎么設(shè)置,希望對(duì)需要的朋友有所幫助!
1. 在~/目錄下, touch創(chuàng)建文件 .Git-credentials
touch .git-credentials vim .git-credentials
點(diǎn)擊 “i” 進(jìn)入編輯文件模式
https://{username}:{password}@github.com 例如 https://zhang3:12345@github.com
點(diǎn)擊“ESC” 然后輸入“:wq”退出編輯并保存
2. 在終端下執(zhí)行
git config --global credential.helper store
3. 可以看到~/.gitconfig文件,會(huì)多了一項(xiàng):
vi .gitconfig 進(jìn)入
可以看到
[credential]
helper = store
4. 再次執(zhí)行 git命令
只需要輸入1次 正確的賬號(hào)和密碼 以后可以直接跳過(guò)輸入賬號(hào)密碼了
推薦學(xué)習(xí):《linux視頻教程》