Git vs xcode snapshot

I am learning a program in iOS through itunesU video and using xcode. I discovered in xcode a snapshot function that I used to take snapshots of my project on every important milestone.

I then move on to the chapter on using git for version control and follow their instructions to the point “git init”, which gave this answer “Reinitialized existing git repository in /Users/username/Developer/Calculator/Calculator/.git/” instead of “initialized empty git repository in /Users/...etc ", which made me think that the snapshot already did this.

My question is: did I somehow pretend to be the snapshots I created in xcode before I ran git init? Thanks.

+7
source share
2 answers

I think you just came across a message instance that does not really have what it says.

The git snapshots and repositories are completely separate. Pictures are saved in:

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

By default, the git project repository is in:

 $SRCROOT/.git 

$ SRCROOT is your project root folder.

For me it’s not like against either "one or the other." I use both. I have an Xcode setup to take snapshots after each build:

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

and commit git:

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

after the completion of each "big change".

That way I can manage the “big stuff” (branches, merges, rollbacks) with git and explore the small “what did I just break?” with snapshots. I rarely have to roll back a snapshot. On the one hand, the only times I can remember were distorted by global search and replacements.

The only drawback is that Xcode will not allow you to compare the current code with the previous snapshot using the difference editor. To compare the current code with the previous snapshot, you should:

  • Open Organizer
  • Click the Projects icon
  • Click on your project.
  • Click on the picture you want to compare.
  • Click the "Export Snapshot" icon at the bottom
  • Resize the drawer to a usable width and compare

Comparing snapshots is not as simple as comparing previous versions of .git, but it saved me a ton of time when a small change broke something in the current build.

Ray

+7
source

Not here and here. You can use GIT in xcode http://repeatgeek.com/tools/using-git-with-xcode-part-i/

0
source

All Articles