本地克隆未知的 Git 分支

发布于 2024-08-24 16:09:43 字数 250 浏览 3 评论 0原文

我有一个有两个分支的 git 存储库。如果我克隆我的存储库,我只能看到主分支。我的两个分支都是最新的。问题是我不完全理解合并和分支。该死的!

我的示例可以在这里看到:

http://github.com/rimian/rimian/network

谁能告诉我如何让它恢复正常?

I have a git repository with two branches. If I clone my repo I can only see the master branch. I have both branches up to date. The problem is I don't fully understand merging and branching. Darn it!

My example can be seen here:

http://github.com/rimian/rimian/network

Can anyone tell me how to get this back to normal?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

仅此而已 2024-08-31 16:09:43

您的克隆存储库中有两个分支,但它们分别称为 origin/masterorigin/ui。默认情况下,它还会创建一个名为 master 的本地分支,用于跟踪 origin/master,这就是您在执行 gitbranch 时看到的内容> 例如。您可以使用命令 gitbranch -r 来查看所有远程分支。您可以创建一个新的本地分支来跟踪远程分支,然后切换到该分支,例如使用 git checkout -tb ui origin/ui 。

You have both branches in your cloned repository, but they are called origin/master and origin/ui. By default, it will also have created a local branch called master that tracks origin/master, and this is what you see when you do git branch for example. You can see all remote branches with the command git branch -r. You can create a new local branch that tracks the remote one, and switch to it, for example with git checkout -tb ui origin/ui.

横笛休吹塞上声 2024-08-31 16:09:43

当我运行

git clone http://github.com/rimian/rimian.git
cd rimian
gitk --all & # You can also use git branch -a if gitk is not installed

gitk 时,会显示一个 ui 分支和一个 master 分支。例如,我可以运行

git merge origin/ui
git push

To get the uibranch的内容到master中并更新github上的master。

请注意,我在克隆时没有使用您发布的网址。我建议您阅读这个关于分支/合并的 github 指南

When I run

git clone http://github.com/rimian/rimian.git
cd rimian
gitk --all & # You can also use git branch -a if gitk is not installed

gitk shows me an ui branch and a master branch. I could for instance run

git merge origin/ui
git push

To get the contents of the ui branch into master and update master on github.

Please note that I did not use the url you posted when cloning. I recommend you read this github guide on branching/merging

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文