October 1, 2013
I just was creating a new iOS project and needed to share it with a dev team. I wanted it private so I used bitbucket.
Here is how I got git working from within xCode 5.
- I generated a new project and made sure I selected the option to create a local repository.
- I created a bitbucket project using their web interface.
- I opened the mac Terminal application.
- Here are the steps in Terminal:
- cd /location/of/new/project
- git remote add origin https://firstname.lastname@example.org/bitbucketusername/projectname.git (you can get this URL directly from the bitbucket sit for the project you created).
- git pull origin master (I had to do this in order to be able to do the later pull)
Then I added a remote to xCode.
- Select: Source Control > projectname – Master > Configure projectname
- Click the Remotes selection at the top of the Configure window
- Click the + symbol in the bottom left of the window
- Select Add New Remote
- Add any name you prefer
- Paste in the https url used to add the remote (https://email@example.com/….)
- Select Add remote
Then I did a commit
- Select Source Control > Commit
- Added an initial commit message to the bottom of the commit window
Last of all I did a push
- Select Source Control > Push
And now everything is all hooked up and working. I can add, change, and delete files and then do commits and pushes