git vs xcode快照 [英] git vs xcode snapshot

查看:108
本文介绍了git vs xcode快照的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习通过itunesU视频在iOS中进行编程,并一直使用xcode。我在xcode中发现了创建快照的功能,我已经使用这些快照在目前的每个重要里程碑处拍摄了我的项目快照。

然后我来找关于使用git进行版本控制的章节,并按照他们的指示指向git init,它给出了这个回应:重新初始化现有的Git仓库/Users/username/Developer/Calculator/Calculator/.git/而不是/Users/...etc中的初始化空git存储库,这使我认为快照已经完成了它。



我的问题是:在我运行git init之前,是否以任何方式搞砸了我在xcode中创建的快照?谢谢。

解决方案

我认为您刚遇到邮件的一个实例并不真正意义。



快照和放映git版本库是完全独立的。快照存储在:
$ b

 〜/ Library / Application Support / Developer / Shared / SnapshotRepository.sparseimage 

默认情况下,项目git存储库位于:

  $ SRCROOT / .git 

$ SRCROOT是您项目的root文件夹。

对我而言,这不是真正的对比或一个或另一个。我使用两者。在每次构建成功后,我有XCode设置可以创建快照:

  Xcode->首选项...->行为 - > Build->成功 - >创建快照

并提交给git:

  Xcode->文件来源控制 - >提交... 

每次大变更完成后。



通过这种方式,我可以管理大东西 (分支,合并,回滚)使用git,并调查小我刚刚打破了什么?与快照的东西。我很少需要回滚快照。我只能回想起唯一一次拙劣的全球搜索&取代。



唯一的缺点是Xcode不会让您使用差异编辑器将当前代码与先前的快照进行比较。要将当前代码与以前的快照进行比较,您必须:


  1. 打开管理器

  2. 点击项目图标

  3. 点击您的项目

  4. 点击您想比较的快照

  5. 点击底部的导出快照图标

  6. 将抽屉大小调整为有用宽度并进行比较

比较快照并不像比较以前的.git版本那么简单,但是当一个小的更改破坏了当前版本中的某些内容时,它为我节省了大量时间。



Ray


I am learning to program in iOS thru the itunesU videos and have been using xcode. I had found in xcode the feature to create snapshots which I have used to take snapshots of my project at each major milestone so far.

Then I come to the chapter on using git for version control and followed their instructions to the point of "git init", which gave this response "Reinitialized existing Git repository in /Users/username/Developer/Calculator/Calculator/.git/" instead of the "initialized empty git depository in /Users/...etc", which led me to think snapshot has already done it.

My question is: have I thus screwed up in any way the snapshots I had created in xcode before I ran "git init"? Thanks.

解决方案

I think you just encountered an instance of the message not really meaning what it says.

Snapshots & git repositories are totally separate. Snapshots are stored in:

~/Library/Application Support/Developer/Shared/SnapshotRepository.sparseimage

By default, a project git repository is in:

$SRCROOT/.git

$SRCROOT is your project's "root" folder.

To me, it's not really a vs. or a "one or the other". I use both. I have XCode set-up to take snapshots after every build succeeds:

Xcode->Preferences...->Behaviors->Build->Succeeds->Create Snapshot

and commit to git:

Xcode->File-Source Control->Commit...

after every "big change" is complete.

This way, I can manage the "big stuff" (branches, merges, rollbacks) using git and investigate the small "what did I just break?" stuff with Snapshots. I rarely have to rollback a Snapshot. Off hand, the only times I can recall have been botched global Search & Replaces.

The only disadvantage is that Xcode won't let you compare the current code to the previous Snapshot using the difference editor. To compare the current code with a previous Snapshot, you have to:

  1. Open the Organizer
  2. Click on the Projects icon
  3. Click on your project
  4. Click on the Snapshot you want to compare
  5. Click on the "Export Snapshot" icon at the bottom
  6. Resize the drawer to a useful width and compare

Comparing Snapshots aren't as easy as comparing previous .git versions, but it has saved me a bunch of time when a small change has broken something in the current build.

Ray

这篇关于git vs xcode快照的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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