USING GIT IN XCODE

[翻译] USING GIT IN XCODE [2]  在XCODE中使用GIT[2]_iOS

http://www.cimgf.com/2013/12/10/using-git-in-xcode/

USING AN EXISTING REMOTE PROJECT IN XCODE

To clone a copy of an existing remote repository, open the Organizer in Xcode and select Repositories.  Click the plus (“+”) button in the lower left hand corner of the Organizer, and select “Checkout or Clone Repository…”.

打开Xcode中的Organizer并选择Repositories,选择下图所示就可以拷贝远程的版本了。

[翻译] USING GIT IN XCODE [2]  在XCODE中使用GIT[2]_xcode_02

Xcode will present a dialog requesting a URL or file path.  Xcode can handle both ssh and https URLs for git repositories.  Be sure to specify the full URL for the repository, which is typically available on the project page for Github or Bitbucket.

Xcode会弹出一个对话框,需要你提供一个URL地址或者是文件地址,Xcode可以处理ssh或者https方式的URL。确保填写的URL是正确的,这个URL地址在Github或者Bitbucket上有提供。

[翻译] USING GIT IN XCODE [2]  在XCODE中使用GIT[2]_翻译_03

If the repository is private and requires authentication, Xcode will request your credentials for the repository.

如果这个版本是私有的而需要你验证,Xcode会要求你输入验证信息。

[翻译] USING GIT IN XCODE [2]  在XCODE中使用GIT[2]_iOS_04

Provide your credentials and click OK.  Xcode will store your credentials in the keychain for subsequent accesses of the remote repository.  Note that Xcode can also handle ssh key authentication in addition to name and password.  Once Xcode has authenticated with the remote repository, Xcode will request a location to store the project, and then project will be cloned.  Once cloned the project can be opened or shown in the finder.

If you run into an issue with using the Checkout or Clone approach and authentication, Select “Add Repository…” instead.  You can then add your authentication information for the repository, and clone from there.  This approach worked for me in cases where using Checkout or Clone did not.

When the clone is complete, the local working copy is ready for updates.

填写了正确的信息后并点击OK,Xcode会存储证书信息到keychain中,便利于随后的版本控制操作。注意哦,Xcode是能够处理ssh方式验证信息的。一旦Xcode验证通过了远程的版本,Xcode会询问你一个本地地址用来存储工程,当你选择好地址后,点击确认,这个工程就可以保存到本地了。

如果你在用 Checkout 或者 Clone approach 时出现了问题,请选择 “Add Repository…”来代替。之后,你可以在那里把你的验证信息添加到版本中,后续使用都是一样的。

当工程项目拷贝结束了,这个本地的版本就可以进行更新操作了。