I have an existing project in XCode 4.5 which is not under any form of source control. All I want to do is add it to a BitBucket repository so that I can work alongside another developer.
I’ve tried and tried to get this code under source control and onto a BitBucket repository, but I just can’t seem to nail it.
Could someone please talk me through it, step-by-step.
-
I’ve created a repository in BitBucket and it’s waiting for my code.
-
To create the repository localled, I ran
git init,git add .andgit commit -m 'Initial version'on the relevant directory. -
BitBucket suggests that I run
hg pushto import an existing repository, but I get the following error:- abort: no repository found in ‘/Users/xxx/Documents/Dev/projectname’ (.hg not found)!
If I go into XCode, I have a repository showing in the Organizer. But it’s not connected with BitBucket at all.
All help very gratefully received. Thanks.
You need to add your bitbucket repository as a remote to your local one. You can do this by running
You then need to push your local files to the remote repo by running
Note that this will push them to the master branch on the bitbucket repo.