4.git提交避免输入密码

git 提交避免输入密码

git 基本配置

全局用户名密码配置

git config --global user.name "beike"
git config --global user.email "beike@qq.com"

全局免密码配置

配置存储模式

git config --global credential.helper store

执行之后会在用户主目录下的.gitconfig文件中多加 helper = store

Linux 下查看:

 vim ~/.gitconfig

windows10 下当前用户路径:%USERPROFILE%

内容如下:

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

单项目免密码配置

编辑项目目录中.git 文件夹下的配置文件 config,修改其中 url 项:

[remote "origin"]
url = https://gitee.com/projects.git

修改为:

[remote "origin"]   
url = https://uxpi:password@gitee.com/projects.git

也就是在 https:// 之后,增加 用户名:密码@

posted @ 2023-06-14 18:33  贝壳里的星海  阅读(280)  评论(0编辑  收藏  举报