I have a really weird issue with one of the guys in the office here where we moved on of the repos from one project in TFS into another (I will use TFS here but I mean Visual Studio Team Services, which is basically TFS in the cloud).
So our repo used to live somewhere like:
https://somewhere.visualstudio.com/projects/_git/something
Then it was copied to another project and the old one removed, so it now lives at:
https://somewhere.visualstudio.com/project_two/_git/something
When one of the guys here tries to clone from the new repo url:
git clone https://somewhere.visualstudio.com/project_two/_git/something
He gets the error:
remote: TF401019: The Git repository with name or identifier something does not exist or you do not have permissions for the operation you are attempting. fatal: repository 'https://somewhere.visualstudio.com/projects/_git/something' not found
Its like there is some cache somewhere which seems to be redirecting the new repo url to the old one, which no longer exists. It doesn't happen for me on my computer.
So is there anything behind the scenes in GIT which would cause this repo url to be cached somewhere, or anything in TFS which would cause this behavior?
== Verbose Output ==
somename@cf-l-003242 MINGW64 /d/Repos
$ GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone https://somewhere.visualstudio.com/project_two/_git/something
10:50:02.761600 git.c:349 trace: built-in: git 'clone' 'https://somewhere.visualstudio.com/project_two/_git/something'
Cloning into 'something'...
10:50:02.801600 run-command.c:336 trace: run_command: 'git-remote-https' 'origin' 'https://somewhere.visualstudio.com/projects/_git/something'
So it looks like the origin is messed up, however he has uninstalled and re-installed git and is cloning a repo to a new folder so I don't know why it would mess up the origin.
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git clone ...
(source) – tom