简体   繁体   English

Git 在 Visual Studio 2019 中同步

[英]Git Sync in Visual Studio 2019

I am using the Sync action from Visual Studio 2019 for getting artifacts from a git server.我正在使用 Visual Studio 2019 中的 Sync 操作从 git 服务器获取工件。 I know that Sync first is doing a pull operation and after that a push operation to the git server;我知道 Sync 首先是执行拉取操作,然后是对 git 服务器的推送操作; but in my case it does not work like expected.但就我而言,它不像预期的那样工作。

If I press Sync I'm receiving this message如果我按同步,我会收到此消息

图像

But after that if I press Fetch I would expect see nothing from incoming commits, even though I'm seeing 2 incoming commits.但在那之后,如果我按下 Fetch,我会期望从传入的提交中看不到任何内容,即使我看到 2 个传入的提交。

Any idea for this behavior?对这种行为有任何想法吗?

As yan commented, you should first check if it's a stable scenario.正如 yan 评论的那样,您应该首先检查它是否是一个稳定的场景。 If you could reproduce this issue stably.如果你能稳定地重现这个问题。

  • sync: performs a git pull and a git push .同步:执行git pullgit push
  • fetch: performs a git fetch which retrieves any commits on from your remote without merging them. fetch:执行git fetch ,从远程检索任何提交而不合并它们。

This is not an expect behavior.这不是预期的行为。 You could use git reflog command to track the logs and check if there is some useful information.您可以使用git reflog命令来跟踪日志并检查是否有一些有用的信息。

You could also have a try with remote git repo hosted by other sever such as GitHub.您也可以尝试使用其他服务器(例如 GitHub)托管的远程 git 存储库。 This will narrow down if it's a client side issue.如果这是客户端问题,这将缩小范围。

Also upgrade your VS2019 to latest version, which may do the trick.还将您的 VS2019 升级到最新版本,这可能会奏效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM