git 为特定项目设置用户名/邮箱/密码 |
您所在的位置:网站首页 › git修改配置的用户名和密码 › git 为特定项目设置用户名/邮箱/密码 |
1、找到项目所在目录下的 .git,进入.git文件夹,然后执行如下命令分别设置用户名和邮箱 git config user.name "aaaaaaa" git config user.email "[email protected]"然后执行命令查看config文件:cat config cat config发现里面多了刚才配置的用户名和邮箱信息user,即成功为该项目单独设置了用户名和邮箱 ... [branch "master"] remote = origin merge = refs/heads/master [user] name = aaaaaaa email = [email protected] 如果git pull 每次都要求输入用户名和密码,则可以执行如下配置 git config credential.helper store执行后, cat config查看,则多了credential的内容: [user] name = aaaaaaa email = [email protected] [credential] helper = store然后再回到项目目录下执行git pull/push,根据提示输入用户名和密码,输入正确后,以后再执行git pull/push 就不用输入用户名和密码了 或者在 2、.git文件夹下的config的文件,在加上用户名aaaaaaa url = https://[email protected]/IBAX-io/ibax.io.git [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = https://[email protected]/aaa-io/aaa.io.git fetch = +refs/heads/*:refs/remotes/origin/*最好是两种方法都用,这样的话会是项目提交起来,效果更清晰。避免全局用户名对项目提交进行污染。 |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |