使用 Xcode 将当前分支合并到 Master

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13129092/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:57:58  来源:igfitidea点击:

Using Xcode to merge current branch into Master

xcodegitversion-control

提问by Ben Packard

Is there a quick way to merge the current working branch into the master branch using Xcode? I'm not clear on what the 'Merge' menu option is doing exactly (it's not exactly labelled clearly), but it seems like it is merging whichever branch you select into your current branch - I guess this is useful when you want to test your changes with the latest codebase from someone else.

是否有使用 Xcode 将当前工作分支合并到主分支的快速方法?我不清楚“合并”菜单选项究竟在做什么(它没有完全清楚地标记),但它似乎正在将您选择的任何分支合并到当前分支中 - 我想这在您想测试时很有用您使用其他人的最新代码库进行更改。

When I finish a feature, I would like to merge it in to the master and then continue working on another feature. It seems like I have to switch to the master branch, merge from there, then make another branch from master and work on feature #2 in that one.

当我完成一个功能时,我想将它合并到母版中,然后继续处理另一个功能。似乎我必须切换到主分支,从那里合并,然后从主分支创建另一个分支并在该分支中处理功能#2。

Do I have it correct?

我说得对吗?

采纳答案by Amber

Yes, that is correct. The "merge" operation in Git takes another branch and merges it into your current branch.

对,那是正确的。Git 中的“合并”操作采用另一个分支并将其合并到您当前的分支中。

What you are describing (creating a branch for each feature, and merging them into master as you go) is generally referred to as the "feature branch" workflow, and it is a very common one.

您所描述的(为每个功能创建一个分支,并在进行时将它们合并到 master 中)通常称为“功能分支”工作流,这是一个非常常见的工作流。

回答by Suragch

To use Xcode to merge the current branch into another branch (for example, the developbranch into the masterbranch), go to Source Control > Your project name and branch> Merge into Branch....

要使用 Xcode 将当前分支合并到另一个分支(例如,将develop分支合并到master分支),请转到Source Control > Your project name and branch> Merge into Branch...

enter image description here

在此处输入图片说明

Then just select the branch that you want to merge it into.

然后只需选择要将其合并到的分支。

enter image description here

在此处输入图片说明

You can view the changes and then make the merge. This is a local repository change. You can go to Source Control > Pushto push the merge to your remote repository.

您可以查看更改,然后进行合并。这是本地存储库更改。您可以转到Source Control > Push将合并推送到您的远程存储库。