为什么`git fetch`会清空我的凭证文件

问题描述 投票:0回答:1
  1. 我的 git 凭据存储在

    /home/user1/.git-credentials

  2. 我有一个存储库,其

    .git/config
    中嵌入了不正确的凭据,格式为
    https://username:[email protected]/your/project/

  3. 如果我在这个项目上运行

    git fetch
    ,它会输出

    remote: Verify
    fatal: Authentication failed for 'https://example.com/your/project/'
    
  4. 到目前为止一切顺利。然而,git 还清空了我的

    /home/user1/.git-credentials
    ,同时将失败的凭证保留在
    .git/config
    中(!!)

  5. Git 版本

    2.34.1
    在上述步骤中始终清空我的凭据。问题是,为什么会发生这种情况?我可以阻止这种行为吗,即请不要触摸我的凭证文件

git ubuntu credentials
1个回答
0
投票

错误可能来自用户,请验证您是否使用了页面顶部相应字段中的新个人访问令牌,并且您没有通过 .git- 中的错误

Feed token
值复制粘贴凭证文件

© www.soinside.com 2019 - 2024. All rights reserved.