As currently I cannot clone repositories from a Bitbucket server, I've found I can still do a series of git init, git remote add etc. to get the repository on my computer. I would like to make sure I exactly produce the equivalent of a "clone". Is the following correct?
git init
git remote add origin -m master https://www.myserver.com/bitbucket/scm/proj/repo.git
# need to do git fetch twice, otherwise for some reason git branch -r
# returns "warning: ignoring broken ref refs/remotes/origin/HEAD"
git fetch
git fetch
git branch -r
git checkout --track origin/master
git checkout --track origin/develop
git checkout --track origin/feature/myfeature
# (etc.. for all the branches I need to work with)
I'm also not sure about the flag -m in git remote is needed or potentially harmful.
Some debug info as suggested by @jthill :
Repository 1
git ls-remote --symref origin HEAD
ref: refs/heads/master HEAD
842163b275ade3ec317543ed3a645f537d719766 HEAD
Repository 2
git ls-remote --symref origin HEAD
ref: refs/heads/master HEAD
1a1044eef2d46a292305dfc10cf076a4cf1e9933 HEAD