How to add an existing Xcode project (4.5) to BitBucket

I have an existing project in Xcode 4.5 that is not under any source control. All I want to do is add it to the BitBucket repository so that I can work with another developer.

I tried and tried to get this code under source control and in the BitBucket repository, but I just can't nail it.

Can someone please ask me through him, step by step.

  • I created a repository on BitBucket and it is waiting for my code.

  • To create a localized repository, I ran git init , git add . and git commit -m 'Initial version' in the corresponding directory.

  • BitBucket suggests running hg push to 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 switch to Xcode, I have a repository displayed in Organizer. But he is not affiliated with BitBucket at all.

All help is greatly appreciated. Thanks.

+4
source share
2 answers

You need to add the bitbucket repository as remote to your local one. You can do this by running

git remote add origin git @ bitbucket.org: username / repositoryName.git.

Then you need to push local files to the remote repo by running

git press start of original

Note that this will lead them to the main branch in the bitpack repository.

+4
source

Although not perfect, I found SourceTree to be very useful with BitBucket.

+2
source

Source: https://habr.com/ru/post/1441783/


All Articles