Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode : Recover complete project from snapshot?

Tags:

xcode

snapshot

today I am playing a bit with the Xcode snapshot feature and I wonder if I could recreate a complete project from a snapshot if all code is lost.

It seems to me in the Snapshot-Manager I can only see snapshots of the current project, not of all projects. So if my projectfile is lost or damaged is there anyway to recover my files from a snapshot?

I also wonder were the snapshots are saved. Not in the project folder I found out already.

like image 834
TalkingCode Avatar asked May 30 '09 14:05

TalkingCode


2 Answers

Go to the "Projects" tab in the Xcode Organizer and select your project. You should see all the snapshots that have been made. Select the snapshot you want to restore to and select "Export Snapshot" to save it somewhere to disk. What you export to disk is your "recovered" version of your project.

I agree systems such as SVN and Git are far superior to Xcode's snapshot mechanism for version control. However, the snapshot mechanism can be very useful. For example, I just made a change to a project. Before making the change, Xcode asked me if I'd like to take a snapshot. After the change it turned out that I didn't want to make that change and so I used this mechanism to restore the project to the prior state.

like image 149
James Bedford Avatar answered Oct 08 '22 23:10

James Bedford


Before trusting Xcode snaphot feature too much, may I suggest you to consider source code management with CVS, SVN or Perforce (integrated in Xcode)?

For me, the main usage of snapshot is during a refactoring session: You create a snapshot before applying refactoring changes, so that you are able to revert your modifications.

like image 40
mouviciel Avatar answered Oct 08 '22 23:10

mouviciel