服务端git clone仓库并设置密码

0 0 393

A、首页git clone仓库

B、修改linxu下的用户密码,不需要输入密码

1. 首先需要 ssh连接到您的 Linux 服务器,在根目录下,使用 touch 命令创建文件 .git-credentials :

touch .git-credentials

2. 然后用 vim 命令编辑此文件:

vim .git-credentials

按 i 键进入编辑模式,输入:

http(s)://{你的用户名}:{你的密码}@你的服务器地址
如:https://290563244@qq.com:password@gitee.com

注意:去掉 {}

3. 在终端下执行如下命令:

git config --global credential.helper store

4. 可以看到 ~/.gitconfig 文件会多一项:

[user]
name = 290563244@qq.com
[credential]
helper = store

5、再次 push 或 pull 试试看吧,不需要输入密码了

留言

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>