在XCode中为一个预先存在的项目设置一个git仓库 [英] Setting up a git repository in XCode for a pre-existing project

查看:94
本文介绍了在XCode中为一个预先存在的项目设置一个git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

在现有的XCode项目中使用Git


创建项目后,在XCode中设置git存储库。 (即你在创建项目时没有创建git仓库)

解决方案


  1. 退出Xcode确保如果这是必要的,但我会这样做以防万一)

  2. 运行终端

  3. 进入项目文件夹目录$ b $找到名为UserInterfaceState.xcuserstate的文件,然后将整个文件名复制到./

  4. echo中。
  5. 将UserInterfaceState.xcuserstate文件粘贴到这里> .gitignore
  6. cat .gitignore

  7. git init
  8. git




  9. git commit -m您可以在此处输入注释。

    您现在有一个存储库,并且您的项目受到源代码控制

    Possible Duplicate:
    Using Git with an existing XCode project

    Setting up a git repository in XCode after a project was created. (i.e. you did not create a git repository when creating the project)

    解决方案

    1. Quit Xcode (not sure if this is necessary but I do it just in case)
    2. Run Terminal
    3. Get into the project folder directory
    4. find .
    5. Find the file that says "UserInterfaceState.xcuserstate" and copy the entire filename up to the ./
    6. echo "paste the UserInterfaceState.xcuserstate file here" >.gitignore
    7. cat .gitignore
    8. git init
    9. git add .
    10. git commit -m "You can type a comment here like now under source control"

    You now have a repository and your project is under source control

    这篇关于在XCode中为一个预先存在的项目设置一个git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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