CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 1 of 1
  1. #1
    Join Date
    Apr 2024

    Problem with git in Visual Studio

    Hi. I'm having a problem with git in Visual Studio 2022. I follow a pattern of "edit", "save", "commit", and "push", then repeat. For the most part, this works well but, sometimes, I get an error message on the "push" that says my local repository is "behind" the remote repository. If I do a "pull" then "push" (sync) I can sometimes fix it, but most of the time I wind up with a "merge conflict". When I use the Merge Editor, sometimes I can muddle through getting it to properly "push", but I'm left with multiple branches in the remote repository - other times I'm left with the wrong changes in the repository. (I've been advised that git in VS is glitchy and that I should commit and push often.)

    I am the only one using the remote repository, so it can't be "other changes".

    I've tried several things, but the problem persists. I do notice that, if I wait a few seconds between the "save" and "commit", or the "commit" and the "push", it seems to work better, but the problem still persists on a random basis. I also notice that the problem seems more likely to occur if I "commit" before "save". In this case I can cancel, then "save" and "commit", but the problem still persists. It does not seem to matter if I choose to "save and commit" from the pop-up. (Note that the difference here is "save" and "commit" as two steps rather than one step.)

    I'm beginning to think that there is a bug in the VS implementation of git. Does anyone have any ideas? Thank you.
    Last edited by alexsokolek; June 14th, 2024 at 12:59 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width