title: Visual studio git error pulling remote branch
body: <p>Using vs2019 git integration ( with bitbucket ) I am getting an error when I try pulling a remote branch.
  The error starts:</p>
  <p>&quot;Offset and length were out of bounds for the array or count...&quot;</p>
  <p>This occurred since I had a problem caused vs2019 to close whilst a push was in process.</p>
  <p>I tried deleting the folder</p>
  <p>C:\Users\username\AppData\Local\Microsoft\Team Foundation\x.0\Cache</p>
  <p>As suggested here: <a href="https://developercommunity.visualstudio.com/content/problem/347771/git-create-branch-from-tag-error.html" rel="nofollow noreferrer">https://developercommunity.visualstudio.com/content/problem/347771/git-create-branch-from-tag-error.html</a></p>
  <p>I also tried clearing the visual studio cache.</p>
  <p>Still errors.</p>
  <p>I guess this is due to wherever vs2019 caches some git data for branches being out of step. Could anyone suggest where that would be or a solution?</p>
  <p>EDIT:</p>
  <p>I can create a branch using sourcetree. This is therefore not a problem in the git repo itself. It's some cache that is used within visual studio for something like the list of branches. Somehow it thinks it has one more than exist so EG it tries to do something with the 9th when there are only 8 in an array it holds in memory. If I had the vs2019 code I could debug this and work out where that data is cached.</p>