How does Xcode work with Git for changing branch and checkout older commit?

Since Xcode at version 4.4.1 doesn’t have a switch branch or checkout older version function, is it possible to do that in bash

git checkout in-app-purchase-to-be-added

or

  • How to make git ignore a sub directory group with gitignore pattern?
  • No git commands (status, show origin) not working, OS X Lion
  • What team workflow processes do you use concerning git?
  • Running bat file with scheduled task and failing with 'There are no child processes to wait for'
  • Can the XCode4 version editor use the git log --follow argument?
  • Create Git branch feature/x/y?
  • git checkout HEAD^2
    

    because all the source code (.m, .h), .xib, and project files, image resources will all change in a blink of an eye, so won’t it cause weird behavior in Xcode? Right now I always quit Xcode, switch branch, and restart Xcode, but maybe there is a faster way.

  • use Winmerge inside of Git to file diff
  • git, whitespace errors, squelching and autocrlf, the definitive answers
  • To monitor why git add . slow?
  • Repositories of conda recipes and packages
  • Path error on Atlassian Bamboo SSH deployment to Heroku
  • Adding files to git index without committing
  • One Solution collect form web for “How does Xcode work with Git for changing branch and checkout older commit?”

    XCode should have a way to switch branch, as described in “Using branches and git with Xcode 4.1”

    First off, bring up the organizer’s repositories view and find your project on the left hand side.
    Click on the yellowish folder labeled Branches inside of it and then at the bottom of the window click on the Add Branch graphic.
    Give the branch a name in the dialog that appears, and be sure to select the checkbox at the bottom to Automatically switch to this branch.

    Automatically switch

    go back into the organizer’s repository view and click on your blue folder again.
    At the bottom of the window you can select Switch Branch
    to go back to your master branch (or whichever you want to merge these changes into).

    See also “Git Branch Management With Xcode”

    switch branch

    For more complex branch switching/creation, yes, you might have to to it through the command-line:

    One thing you need to be aware of if you are performing git version control from the command line with the project open in Xcode is that it does not always immediately spot when you have changed something.
    I find with the Organizer that you need to switch between some different views before it spots that the current branch has changed.

    So closing/re-opening XCode might not always be needed, depending on the nature of your project.

    Git Baby is a git and github fan, let's start git clone.