【问题标题】:Git Failed with a Fatal Error in Visual StudioGit 因 Visual Studio 中的致命错误而失败
【发布时间】:2023-03-26 11:30:01
【问题描述】:

一段时间以来,我一直在将我的项目从 Visual Studio 2017 拉出并推送到 TFS。 直到最近,我都无法从远程仓库中拉取

我收到此错误:

Git 因致命错误而失败。 拉 --verbose --progress --no-edit --no-stat --recurse-submodules=no origin

我尝试了不同的方法来解决这个问题

  1. Team Explorer/Settings/Repository Settings,我检查了覆盖全局用户名和电子邮件,并手动输入了该 repo 的凭据——没有修复它

    李>
  2. 我从 Visual Studio 安装程序重新安装了 Git——没有修复它

注意:我尝试在 VS 中拉入或推送的每个项目都会发生这种情况(甚至是不在 TFS 中的项目)

我该如何解决这个问题?

【问题讨论】:

  • 我首先要检查的是来自 Git bash 的 git status。这应该可以告诉您幕后真正发生的事情。
  • 我忘了提到我使用 git bash 来拉取和推送到原点,但不知何故,即使我得到 git bash 的肯定响应,它也没有拉取或推送
  • 检查我的 git 状态 ==> $ git status On branch working Your branch and 'origin/working' have diverged, and have 1 and 3 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working tree clean

标签: git tfs visual-studio-2017


【解决方案1】:

考虑到本地和远程分支已经发生分歧,您可以将 Git 设置为“做正确的事情”(即在远程分支之上重新定位您的本地工作)。见“Can “git pull” automatically stash and pop pending changes?

git config --global pull.rebase true
git config --global rebase.autoStash true

这样,TFS 应该做一个git pull(正如你提到的),在这种情况下你获取origin/working,并在origin/working 之上重新设置working
这比使用Visual Studio to do the same rebase 更容易。

【讨论】:

    【解决方案2】:

    您已更改 TFS 密码,但未在控制面板的用户帐户中更新 在用户帐户中更新您的 tfs 帐户密码 控制面板 -> 用户帐户 -> 管理您的凭据 -> 窗口凭据

    在这里找到像 tfs.***.com 这样的 tfs url 并点击编辑 并更新将您的 tfs 帐户密码放在这里。 现在重启你的系统,现在可以试试了

    【讨论】:

      猜你喜欢
      • 2017-07-28
      • 1970-01-01
      • 2019-01-21
      • 2019-09-18
      • 1970-01-01
      • 2019-12-22
      • 2020-06-18
      • 1970-01-01
      相关资源
      最近更新 更多