【问题标题】:Github commit with different userGithub 使用不同的用户提交
【发布时间】:2021-02-07 17:07:07
【问题描述】:

我有一个 github 帐户。当我提交时,它显示的用户与我的 github 帐户用户名不同。我该如何解决?

【问题讨论】:

    标签: git github commit git-commit


    【解决方案1】:

    在本地文件夹的根目录下有一个名为“config”的文件。 尝试“vim .git/config”

    文件看起来像这样:

    [core]
            repositoryformatversion = 0
            fileMode = false
            bare = false
            logallrefupdates = true
            ignorecase = true
            precomposeunicode = true
    [remote "origin"]
            url = https://nanhe@bitbucket.org/nanhekumar/myproject.git
            fetch = +refs/heads/*:refs/remotes/origin/*
    [branch "master"]
            remote = origin
            merge = refs/heads/master`
    
        [user]
                name = Nanhe Kumar
                email = info@nanhekumar.com
    

    几个选项:

    1. 更改此文件中的用户名和电子邮件
    2. 使用“git config”命令更改推送到 github 的全局用户或特定文件夹项目的本地用户:

    本地:

    • git config --local user.name ""
    • git config --local user.email ""

    全球:

    • git config --global user.name ""
    • git config --global user.email ""

    【讨论】:

      猜你喜欢
      • 2017-11-13
      • 2014-03-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-10-27
      • 2012-02-14
      • 1970-01-01
      相关资源
      最近更新 更多