Saturday, August 23, 2014

Move Existing Xcode project into Bitbucket

I have been using Bitbucket to manage the source code of my personal projects. But I always use the git command in Terminal.

I started working on a new project today and I found it's very easy to move an existing project, which has been managed with the embedded git in Xcode, into Bitbucket. Here are the steps:
  1. Create a new repository for your project in Bitbucket.
  2. Xcode -> Preference, then press the add button("+") to add a repository with the address you created in Bitbucket for your project. e.g.
    https://allesgut@bitbucket.org/allesgut/racenews.git
  3. cd your home directory for your project. e.g.
    cd ~/dev/iOS/RaceNews
  4. set up git on your machine. e.g.
    git remote add origin https://allesgut@bitbucket.org/allesgut/racenews.git
  5. Commit your changes to local server:
    Xcode -> Source Control -> Commit
  6. and push your projects to Bitbucket.
    Xcode -> Source Control -> Push
Now, you can check the source code in Bitbucket to see if the source code of your project has been moved to Bitbucket.

No comments: