在我的笔记本电脑上克隆我自己的 git 存储库后,无法看到新创建的分支
我在桌面上设置了一个安全的 git 存储库设置,我可以从任何地方访问和克隆它。然而,克隆存储库后,我只能看到 master 分支,而看不到我在桌面上创建的新 dev 分支(这是我的 git 服务器)。需要明确的是,服务器上的开发分支还没有任何数据,但在我的笔记本电脑上克隆该存储库后,我至少期望看到它存在。
请帮忙!!
I have setup a secure git repo setup on my desktop which I am able to access and clone from anywhere. However after cloning the repository I can only see the master branch and not the new dev branch that I have created on my desktop (which is my git server). Just to be clear the dev branch on the server does not have any data yet, but I was atleast expecting to see that it exists, after cloning that repo on my laptop.
Please help!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
完成克隆后,执行以下操作:
这将创建并切换到 dev 分支。
如果您正在谈论在克隆存储库上创建分支,请
切换到该分支。
After you do the clone, do:
This will create and switch to the dev branch.
If you are talking about having created the branch on the clone repo, do
to switch to the branch.
您可以使用以下命令查看所有现有分支:
对于基本存储库(仅限主分支),输出为:
在简单的 gitbranch dev 后, gitbranch -a 的输出> 应该是:
如果你想在远程存储库上创建一个分支:
或者如果你想保留本地分支的名称:
并且
git Branch -a
应该给出:You can see all the existing branches with :
For a basic repository (master branch only), the output is :
After a simple
git branch dev
, the output ofgit branch -a
should be :If you want to create a branch on your remote repository :
Or if you want to keep the name of the local branch :
And
git branch -a
should give :您需要首先从原始存储库中推送分支:
然后从新克隆中获取:
现在在本地创建并签出分支:
You need to push your branch up first from the original repo:
Then fetch from the new clone:
Now create and checkout the branch locally: