简体   繁体   English

如何在GitHub Desktop中选择一个分支来更新本地存储库?

[英]How to choose a branch in GitHub Desktop to update the local repository?

I just updated my GitHub Desktop and it looks different. 我刚刚更新了GitHub Desktop,它看起来有所不同。 I need to update my local branch from branch XXX but I don't know how to choose branch XXX. 我需要从分支XXX更新本地分支,但是我不知道如何选择分支XXX。 The new UI has an option of current branch and I am choosing my own branch but how can I choose a branch from which I need to update my branch. 新的用户界面具有当前分支的选项,我正在选择自己的分支,但是如何选择需要从中更新分支的分支。

在此处输入图片说明

I have 2 branches in which we usually merge our changes. 我有2个分支,通常我们在其中合并更改。 XX1 and XX2 I need to update my local repo from XX2 and I don't see any option to choose XX2 and update my local.Please let me know how can I do it in newer version of GitHub Desktop. XX1和XX2我需要从XX2更新我的本地存储库,并且看不到任何选择XX2并更新我的本地存储的选项。请让我知道如何在较新版本的GitHub Desktop中进行操作。

You should click 'Fetch origin' to be sure your local git knows what's going on in remote. 您应该单击“获取来源”以确保本地git知道远程发生了什么。 After doing so, you should see the branch available when you click on Current branch. 这样做之后,当您单击“当前”分支时,您应该看到可用的分支。 Just click on it to check it out and pull from origin if necessary. 只需单击即可将其签出,并在必要时从原点拉出。

So, after a long time I found the answer. 因此,经过很长一段时间,我找到了答案。 This is mainly because of lack of documentation. 这主要是由于缺乏文档。 Anyways. 无论如何。 There is tab called Branch in the new UI. 新用户界面中有一个名为“ Branch选项卡。 Once you click on that you see an option merge into current branch . 单击后,您会看到一个选项merge into current branch By click on this option rest is self explanatory. 通过单击此选项,其余内容不言自明。 Choose your branch and the branch you want to get the updates from. 选择您的分支以及您要从中获取更新的分支。 Once this is done fetch origin will change into pull origin and the local copy will be updated. 完成此操作后,提取原点将更改为提取原点,并将更新本地副本。

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM