我已经换了一台新机器。
我已经按照以下方式在我的新机器上设置好了自己;
git clone -b develop git@github.com:example/example.git example
那给了我;
develop
master
在我的旧机器上,我创建了功能分支并将其推送到仓库中。
在旧机器上,git branch
的输出如下:
develop
feature/ecommerce-one
feature/ecommerce-two
feature/ecommerce-three
master
我该如何将这些特性分支放到我的新机器上?
无论一次全部还是逐个,我都可以接受。
我尝试过 git clone https://github.com/example/example.git --branch feature/ecommerce-one --single-branch
,但是它在当前目录内,所以它只是在该目录下重新创建了整个项目。
git clone
已经复制了来自 origin 的所有分支。如果在您的新机器上运行git branch --remote
没有列出功能分支,则它们不存在于 origin 存储库中,您可能从旧机器上没有将它们推送到 origin。 - bames53git branch --remote
不错的技巧。 - mikelovelyuk