在 Xcode 9 上切换分支
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/44396681/
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
Switching branch on Xcode 9
提问by Alexander MacLeod
回答by vadian
回答by Rushabh
Expose the left side window (Navigator) in your Xcode by selecting this option (you will see this on the top right side of your Xcode window):
通过选择此选项在 Xcode 中显示左侧窗口(导航器)(您将在 Xcode 窗口的右上角看到它):
Now select the second tab:
现在选择第二个选项卡:
Right click on the branch you are intending to checkout and hit the checkout button from menu:
回答by Jayprakash Dubey
It seems that Apple has moved Source Controlsfeature like change branch
, version history
to separate tab in Navigator areafor Xcode 9.x
似乎 Apple 已经将Source Controls功能如change branch
,version history
移到Xcode 9.x 的导航器区域中的单独选项卡
Below are step to perform branch switch :
以下是执行分支切换的步骤:
- Open the
Navigator area
(if it is hidden) by pressing left pane window present on top right of Xcode or use shortcut cmd + 2
Navigator area
通过按 Xcode 右上角的左窗格窗口打开(如果它是隐藏的)或使用快捷方式cmd + 2
- In
Source control navigator
you can seeBranches
,Tag
present for your project.
- 在
Source control navigator
你可以看到Branches
,Tag
为你的项目呈现。
Now, if you want to switch branch then select the branch to switchand right clickon it.
Select Checkout. This will prompt an alert
Do you want to check out “<branch name>”?
SelectCheckout
.
现在,如果要切换分支,请选择要切换的分支并右键单击它。
选择结帐。这将提示一个警报
Do you want to check out “<branch name>”?
SelectCheckout
。
- Now this will switch your branch to selected one after sometime.
- 现在这将在一段时间后将您的分支切换到选定的分支。
Note: In order to switch between branches you need to commit or discard changes done in project.
注意:为了在分支之间切换,您需要提交或放弃在项目中所做的更改。
- You can even see Log historyby selecting branch. Commit history can be viewed based on last 24 hours, last 7 days and last 30 days.
- 您甚至可以通过选择分支来查看日志历史记录。可以根据过去 24 小时、过去 7 天和过去 30 天查看提交历史记录。
回答by Josh O'Connor
回答by Teja Kumar Bethina
Follow the below link for the clear explanation of each and every functionality like, Commit, pull, push, etc.
按照下面的链接清晰地解释每个功能,如提交、拉取、推送等。
https://www.raywenderlich.com/153084/use-git-source-control-xcode-9
https://www.raywenderlich.com/153084/use-git-source-control-xcode-9