Linux让git记住账号密码

Linux让git记住账号密码

 

摘要: Linux让git记住账号密码。

 

1、进入根目录,指令:cd /

2、创建记录账号密码的文件,指令:touch .git-credentials

3、用vi打开文件,指令:vi .git-credentials

4、按i,进入编辑模式

5、输入https://{username}:{password}@github.com,其中,将{username}替换为你的账号,{password}替换为你的密码,https://.......@github.com替换为你的git仓库地址

(举个例子:http://zhangsan:123456@10.0.0.1)

6、按Esc键,然后按:wq,保存并退出(那个:是需要同时按着shift键才能出来的)

7、让git读取刚才建立的文件,指令:git config --global credential.helper store

8、执行一次git操作,比如git clone xxxxxx,然后输入账号密码,这次账号密码将会被记录下来,以后不用再输入了

posted @ 2019-01-16 16:09  liangwp  阅读(8268)  评论(0编辑  收藏  举报