git vs xcode snapshot

前端 未结 2 474
梦毁少年i
梦毁少年i 2021-02-06 09:17

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 m

相关标签:
2条回答
  • 2021-02-06 09:20

    There is no vs here. You can use GIT in xcode http://repeatgeek.com/tools/using-git-with-xcode-part-i/

    0 讨论(0)
  • 2021-02-06 09:25

    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

    0 讨论(0)
提交回复
热议问题