HOWTO Get local code base with SourceTree 3.0.6 to Bitbucket as-is. Step #1.
Asked by John Brumbelow:

Please help,

We are just starting with Bitbucket, and need to get our local code base to Bitbucket.

We can log into the bibucket.org link for where we want our code base to end up, but all efforts to get SourceTree to upload our local code base to our repo is failing, and Source Tree only shows a huge blob of text in the "Committing" screen, that ends with the error "Completed with errors, see above.".

All on-line documentation for Bitbucket, and SourceTree is not helping, as they all seem to be out of date, as version 3.0.6 for SourceTree does not have any of the same screens as documentation anywhere.

.


Answers:
author: John Brumbelow
body: I have the solution to this.

Bitbucket/SourceTree out-of-the-box with SourceTree's GUI , does not allow one to go from local first to repo. Others have posted many complaints of this, but this is SourceTree/Bitbucket out of the box, as of SourceTree 3.0.6.

One must start with Bitbucket.org 1st, create their repo there. There i no way around this with the out-of-the-box GUI for SourceTree.

After creating the repo, go to your local file system, and temporarily rename you code base's root folder, then create a new empty folder.

Go into SourceTree, choose Clone repo, and point it to the newly created empty folder.

Then go back to your local file system, and copy/move the sub-folders from the temporariliry renamed folder to the empty one.

Then you can commit/push the files (not empty folders), files, which will get their folder, to the repo.


author: John Brumbelow
body: Thank you for the response.

We did the steps you mentioned for SourceTree, and they lead to the error "Completed with errors, see above".

As for the command line options, we must stick 100% to using the GUI in SourceTree.

Our team has non-technical people, and if we have to even slightly consider using any kind of command line, for anything, we will have to consider other repo tools.

comments: author: John Brumbelow
body: Here is the full text of that error when we try to push to the repo, with the senstivie data obfuscated with \~\~\~\~\~

comparing with https://\~\~\~\~\~\~/csc.get

abort: HTTP Error 404: Not Found

When using SourceTree to click on the menu "Repository" and then choose "View repository online" works.


author: minnsey
body: Hi  

I'm assuming you created the repository in the Bitbucket web site and that your local code is **not** managed in git already?  

In Sourcetree for Windows, in the *New Tab/Create* panel, you can select to your existing folder as the *Destination Path* , unselect the *Create Repository on Account* option and then click *Create* .  

This will effectively run *git init* against your folder.

Once Sourcetree has opened the tab for the repository you can open *Repository Settings* behind the cog upper right and add the remote of the Bitbucket repository you want to use.  

you should then be able to add your existing files, commit and push to Bitbucket.  

Alternatively these are command line instructions here <https://confluence.atlassian.com/bitbucket/add-unversioned-code-to-a-repository-877177133.html>  

if you code is already in a local **git** repo then in Sourcetree you can add the existing repository and then set the *Repository Settings* .  

Or use the command line options here <https://confluence.atlassian.com/bitbucket/push-versioned-code-to-an-empty-repository-877177145.html>  

Source