今天分享下Xcode的Source Control,和其它IDE一样,Xcode也包含一个代码版本控制的工具,包括代码版本控制的基本操作,如checkout、update、commit、show log等。
The first time you save a project created from a template, you have the option of enabling source control. If you don’t have a GIT or Subversion server setup, select “Create Git repository on” and choose My Mac from the pop-up menu. Otherwise, choose Add
To New Server, and in the following sheets, provide the server information.
To checkout an existing project in a repository, choose Source Control > Check Out, and provide the server information in the following sheets. Choose a server from the table or enter a server address in the text field below. Click Next, enter your credentials,
and click Next again. Choose a location for your working copy and click Download. If successful, the Source Control menu items are enabled.
To see the files you modified in the navigator, click the project navigator () and click the source control status icon in the filter bar. The project navigator shows only the files that have a source control status such as modified (M). You can use this filter
bar to view the set of files you are actively modifying.
To see the changes you made to a file, select the file in the project navigator, choose the version editor () in the toolbar, and choose an option from the pop-up menu. To compare file versions, choose Comparison. To find out who last changed each line of code
in your file, choose Blame. To view the source control log for the file, choose Log.
If you choose Comparison, the editor compares the local revision with the last revision committed to source control. For each change, Xcode shows the line that changed and highlights the changes to the line. To compare the local revision to an older revision,
choose the older revision from the jump bar on the right. To compare any two revisions, select them from the jump bars on the left and the right.
To save the changes you made to files, choose Source Control > Commit. In the sheet that appears, optionally review the changes and exclude or discard specific changes. Then enter a commit log message, optionally select “Push to remote”, and click the Commit
button.
本文介绍了如何使用Xcode的SourceControl功能进行代码版本管理,包括创建本地仓库、检出远程项目、查看修改状态及文件版本对比等基本操作。
234

被折叠的 条评论
为什么被折叠?



