为现有的Xcode 5项目添加本地回购 [英] Add local repo for existing Xcode 5 Project

查看:93
本文介绍了为现有的Xcode 5项目添加本地回购的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经运行了Xcode 5教程,希望做出一些重大更改,但希望将此Xcode 5项目放入存储库。

I've running through a Xcode 5 tutorial and want to make some significant changes, but want to make this Xcode 5 project into a repository.

我已经做了一些阅读,你可以通过转到Xcode - >首选项 - >帐户 - >添加库 - >输入存储库地址来添加一个存储库:

I've done some reading and you can add a repository by going to Xcode -> Preferences -> Accounts -> Add Respository -> Enter the repository address:

在这里为本地存储库(在我的iMac)我想工作?

So what would I input here for a local repository (on my iMac) I'm wanting to work on?

干杯。

推荐答案

我会从命令行执行此操作。

I would do this from the command line.


  1. 关闭 Xcode。

  2. 打开 Terminal.app


  3. $ git init。 li>
  4. 创建一个 .gitignore 文件来忽略一些你不想跟踪的Xcode和输出文件(见下面)。 li>
  5. $ git add .gitignore

  6. $ git add。
  7. code>
  8. $ git commit -a -m初始。

  1. Close Xcode.app
  2. Open Terminal.app
  3. $ cd /path/to/project/dir
  4. $ git init .
  5. Create a .gitignore file to ignore some of the Xcode and output files that you don't want tracked (see below).
  6. $ git add .gitignore
  7. $ git add .
  8. $ git commit -a -m Initial.

示例(但不完整) .gitignore file:

Sample (but incomplete) .gitignore file:

build/
*/xcuserdata/

最有可能的是,您希望添加远程跟踪回购,也许在github或bitbucket上(一旦 bare 回购)

And most likely you'll want to add a remote tracking repo, perhaps on github or bitbucket (once a bare repo has been created there):

$ git remote add origin https://bitbucket.org/yourname/yourrepo.git
$ git push -u origin --all
$ git push -u origin --tags

下次打开Xcode项目时,它将准备好使用源代码。

When you open the Xcode project next time it will be ready for Source Code use.

这篇关于为现有的Xcode 5项目添加本地回购的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆