Search code examples
xcodeversion-control

Run older commits of project in Xcode


I am using Xcode with source control. Is it possible to select an older commit of the actual project (just like in the Revisions tab) and run it without the need of git cloning?


Solution

  • It's relatively straightforward using the command line.

    If the commit you want to target is named 0ad5a7a7, then you can create a new branch via this:

    git checkout -b old-project-state 0ad5a7a7
    

    After creating that branch, you can change to it via Xcode's "Switch To Branch" menu item and you can then build it.