git修改针对全局或当前项目的git用户名密码

git修改针对全局或当前项目的git用户名密码

修改日志显示额用户名方法

  1. 切换到需要修改的项目目录

  2. 项目目录中.git开头的目录,可进入到.git目录:

  3. 执行命令

    git config user.name '用户名'
    
  4. cat config
    

    可以看到name已经修改

  5. 执行新增配置

  6. 执行:

    git config credential.helper store
    
  7. 查看config文件:

    cat config
    

    看到最后一行新增了helper

修改项目时提示没有权限,需要更换用户名密码

git remote set-url origin https://[用户名]:[密码]@[git地址]
//不设置用户名和密码的情况
git remote set-url origin https://[git地址]

git地址没有https前缀,单纯是后面的网址即可

修改git提交用户名

//修改全局
git config  --global user.name 你要设置的用户名;
git config  --global user.email 你要设置的邮箱;
//修改当前项目
git config user.name 你要设置的用户名;
git config user.email 你要设置的邮箱;

删除远程端的分支

git push origin --delete [branch_name]

码云上有针对添加公钥的步骤:
https://gitee.com/help/articles/4181#article-header0

总结

修改日志名称:找到项目执行3,6,8即可

修改用户名密码执行一条命令行即可

你可能感兴趣的:(git,github,git)