Irritating problem
There is an amalgam of complaints about this issue already on the product form, you can view them here: https://developercommunity.visualstudio.com/content/problem/26914/team-explorer-does-not-recognize-previously-cloned.html
The scenario for this problem to play out is like so:
- Your TFS administrators have changed the URL to your copy of TFS
- Uou are using Git and not TFVC
- You update your team connection in Visual Studio 2017 to point to the new URL
- You now see that your Visual Studio 2017 instance will not recognize the fact that you already have a repo downloaded
Possible workaround
I am not going to say this is going to work for everyone. I feel like because TFS Git is still buggy you have to coerce TFS to work sometimes using alternate means. Out of habit, because TFS doesn’t seem to be quite finished baking yet when it comes to Git, I have SourceTree installed as a back up. Here is what I just did (writing it down while it is still in my mind):
- Close all Visual Studio instances to err on the side of caution (it can block you sometimes)
- I updated my connection information in SourceTree for the target repo I am working with
- Open your local repo
- At the top in the menu bar, click on:
- Repository
- Repository Settings…
- Edit your URL
- Alternatively you can edit the URL by editing the config file if that is easier for you:
- <YourRepo>\.git\config
- You will see your URL in there, just edit it – it can potentially show up multiple times, change all of them
- I committed my local changes with SourceTree
- I pushed my changes with SourceTree
- I re-opened Visual Studio using the solution associated with my local repo
- I attempted to re-establish a connection between my solution and the server and for some reason this worked…
I can’t explain why this worked, but it did.
If I had to guess, SourceTree over-wrote something or unjarred something for a lack of better explanation.
I hope Microsoft fixes this problem soon because it is a huge time waster.
SourceTree side note
If you are using SSL for your TFS URL and SourceTree gives you a problem with your connection because of this, then make SourceTree ignore SSL.
fatal: unable to access
<URL>
: SSL certificate problem: unable to get local issuer certificate
Check out the answer here: https://stackoverflow.com/a/32239330/603807
Tools > Options > Git > Disable SSL certificate validation (ticked)