【发布时间】:2019-02-21 15:47:11
【问题描述】:
目前I cannot clone repositories from a Bitbucket server,我发现我仍然可以执行一系列 git init、git remote add 等操作来获取我计算机上的存储库。 我想确保我完全产生了相当于“克隆”的东西。 以下是正确的吗?
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)
我也不确定 git remote 中的标志 -m 是否需要或可能有害。
@jthill 建议的一些调试信息:
存储库 1
git ls-remote --symref origin HEAD
ref: refs/heads/master HEAD
842163b275ade3ec317543ed3a645f537d719766 HEAD
存储库 2
git ls-remote --symref origin HEAD
ref: refs/heads/master HEAD
1a1044eef2d46a292305dfc10cf076a4cf1e9933 HEAD
【问题讨论】:
标签: git bitbucket git-clone bitbucket-server