Welcome to today’s post.
In today’s post I will discuss a workaround for the error / warning that occurs after you commit / sync a branch, then attempt to switch to the master branch. You then get the following error:
“git an operation is still in progress. please wait and try again”
The above is the same error we experience when we merge source code from a local Git repository into a branch within a remote Git repository, which is what I have discussed in one of my previous posts.
In the Visual Studio Team Explorer while you are in an existing Git branch, the error shows up like this:
In the next section, I will discuss two workarounds for the above issue.
Workarounds to Remediate the Issue
In this section I will cover two workarounds to remediate the above issue within the Visual Studio Team Explorer.
The first workaround I will suggest is as follows:
Attempted Workaround 1
Open a Git bash command prompt.
Run the command:
git checkout <branch>
Return to the Visual Studio 2017 IDE.
Check if the solution build option is showing. If it is showing, then the operation has completed.
If the build option is not showing, then we proceed to try the next workaround.
Attempted Workaround 2
Close the Solution in the Visual Studio IDE.
Close the Git Bash command prompt.
Close Visual Studio 2017.
Open Visual Studio 2017.
Open Team Explorer.
Select the master branch. The notification shows below in the IDE.
Confirm if the build option is showing in the project in solution explorer.
If the build option is showing, then the operation has completed.
The above are workarounds for a known bug within Visual Studio 2017 for open Git repositories. Part of the workaround involves using commands within the Git bash environment.
That is all for today’s post.
I hope that you have found this post useful and informative.
Andrew Halil is a blogger, author and software developer with expertise of many areas in the information technology industry including full-stack web and native cloud based development, test driven development and Devops.