如何配置GitHub登录账号密码,进行免密push仓库文件
git config
命令的–global
参数,用了这个参数,表示你这台机器上所有的Git
仓库都会使用这个配置,当然也可以对某个仓库指定不同的用户名和Email
地址。
# 查看git配置信息
git config --list
1
# 查看git用户名、密码、邮箱的配置
git config user.name
git config user.password
git config user.email
1
2
3
2
3
# 设置git用户名、密码、邮箱的配置
# 局部配置
git config user.name “zll”
git config user.password “123456”
git config user.email “123456@163.com”
1
2
3
2
3
# 全局配置
git config --global user.name “zll”
git config --global user.password “123456”
git config --global user.email “123456@163.com”
1
2
3
2
3
# 修改git用户名、密码、邮箱的配置
# 局部配置
跟设置语法一样,没有用户名就添加,有了用户名就修改
git config user.name “zll”
1
# 修改git用户名、密码、邮箱的配置(全局配置)
# 全局配置
跟设置语法一样,没有用户名就添加,有了用户名就修改
git config --global user.name “zll”
1
# 修改配置文件
进入.git
文件夹编辑config
文件,修改url
。例如:
[remote "origin"]
url = https://github.com/zlluGitHub/zlluGitHub.github.io.git
1
2
2
修改为
[remote "origin"]
url = https://<账号>:<密码>@github.com/zlluGitHub/zlluGitHub.github.io.git
1
2
2
上次更新: 2024/01/30, 00:35:17