I used to have a git post-checkout hook that set the repo identity based on the repo origin url [0] on checkout - maybe there's some post-clone hook these days, but 10 years ago when I wrote it there was only post-checkout hook.
[0] https://www.dvratil.cz/2015/12/git-trick-%23628-automaticall...