Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to add files folders to empty repo

Sascuash Kirtash March 31, 2014

Hi, I have an empty repo where I want to add a local project (not repo).

How can I upload my files/folders so it becomes a bitbucket private repo?

10 answers

1 accepted

16 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

Ok. So you want to start by making a new private repo on bitbucket. On your dashboard, you can "Create Repository". It can be git or hg (short for mercurial), your choice.

To interact with your new repository, you'll need to clone this repository to your local machine using a git/hg client. Many here would recommend SourceTree (another Atlassian product, integrates well with Bitbucket, you can use a "Clone To SourceTree" button in Bitbucket to make things easier) but any git client will work. The information you need for SourceTree or command line is in the "Clone" dropdown.

Once you have a local repository, copy/move your project into it, and use your chosen tool to add/commit the files and push them to bitbucket.

As far as I can tell, there is no way to upload files directly to an empty repository on Bitbucket except by pushing from a git/hg client.

Sascuash Kirtash March 31, 2014

Thanks for the info

Charles Robertson October 7, 2015

Thank you. This is the first concise answer. I have been tearing my hair out just trying to do this simple task. It would be easier if you could just add an existing local folder with files in it, but you have to add an empty local folder and then copy files into it. Strange. I kept getting a message saying that the folder already has files in it, please choose an empty folder. Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!

Like # people like this
Andre Stephenson January 24, 2017

What if I already have a private repo with a README.md file and I just want to add a folder with some css, html, js files to the repository? What do I do? 

Like zepre likes this
john1440 March 20, 2017

This is so dumb. What's so hard about uploading some files? Grrr....

Like # people like this
David Parham June 30, 2017

lol glad you asked, John. perhaps you can riddle me this: i have on my local, folder A and B [each is set up via git init]. on Bitbucket, i have a public key. on Bitbucket i have root folder, and folders A and B. i can add, commit, and push from my local folder A, to my root folder in bitbucket. but i cannot push from folder B to anywhere. >>i want to be able to push from folder A local to Bitbucket folder A, and local B to Bitbucket B. my errors are a few that i get as i try different things:

git push - says i need to do "git push --set-upstream origin master", but that says repository does not exist. so i do a "git remote add origin: git@bucket.org:mydomain/rootfolder.git/anotherfolder/folderB, that says "remote origin already exists".

i double check my ssh: ssh-add, that shows my identity already added. also, eval "$(ssh-agent)" returns, "Agent pid 20268".

git push origin ==> 'master' does not appear to be git repo. fatal - could not read from remote repo. make sure you have correct rights.

going in circles! yet, from my other folder, A, i can push no problem.

HELP?

Like # people like this
Georgi Dimitrov October 9, 2019

I  have a folder on my computer with my server. I can not put it on a repo in bitbucket, unless I add 14000 files one at a time? what do I do?

1 vote
Neha223 April 18, 2019

To add files & folder into empty repo:

1. First make clone of that empty existing repo onto your local machine by using command "git clone your repo path".

2. After making clone ,paste your files & folders into that clone.

3. After open git bash from clone directory & just add your code by using "git add -A" command,then commit using command "git commit -m "your message"" & then final push your code using command "git push".

 

Thats it.

natalieastrup April 14, 2022

Push the file to BB, the folder will go too

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

As a new user, have you checked Bitbucket 101?

john1440 March 20, 2017

404

Like # people like this
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 21, 2017

If you'd rather, you can start here: https://confluence.atlassian.com/bitbucket/bitbucket-cloud-documentation-home-221448814.html

The Bitbucket 101 link still exists in their documentation, but as you mentioned, it returns a 404.

Shriganesh Singh July 10, 2017

The Get Started link in the above URl returns

503 Service Unavailable

No server is available to handle this request.

 

Is there any other links for new users to learn?

didkivskyy September 14, 2018

So, Bitbucket 101 has been multiplied by four...

Like # people like this
0 votes
James Young August 3, 2020

I struggled with this as well for a good half an hour!

Go to your top level project (as given in the URL https://bitbucket.org/top_level_project) then click Settings, SSH Keys, and add key there.

Make sure the SSH key hasn't been added elsewhere, like per person settings.

If you have read/write permissions on the repository (check your groups), then that's all you have to do. ssh -T git@bitbucket.org should tell you:

logged in as top_level_project

You can use git or hg to connect to Bitbucket. Shell access is disabled

Set up your username and key file in your ~/.ssh/config file. Good luck!

0 votes
Abenezer Tesma January 9, 2019

Thanks 

0 votes
jacco jansen November 1, 2017

I installed a free app from the Mac App Store called SnailGit Lite. It is a lightweight client that extends Finder to allow you to use Finder as your Git client rather than SourceTree etc. 

All you need to do is navigate to the folder you want to turn into a repo and click the button in Finder and select "Create a repo here". Boom. That folder is now a repo, ready to be uploaded/committed to wherever.

Admittedly, I ran into the annoying and numerous "Make sure you have permissions" bugs where I first have to setup SSH keys and all that nonsense before I am allowed to upload / download anything so I went back to SourceTree after this step but still... You say your repo is empty, right? So just turn the current folder into a Repo. Start up SourceTree and commit that brand spanking new repo. 

Two clicks in Finder (literally) vs creating a repo online, cloning it, moving files around and then uploading back again... your choice :)

0 votes
Ivan Caceres September 18, 2017

Dear,

Please help with the configuration of Bitbucket Server to be able to view the push sent from SourceTree, since at the moment I have made all the required configurations but when adding a file in the cloned local repository, it is committed and sent by Push to the Server , but it is not displayed.

Please if anyone can give me support regarding the subject.


First of all, Thanks.

 

Regards.

0 votes
Sascuash Kirtash March 31, 2014

none for this proyect, it's just a phonegap project

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

It sounds like you have created an empty local repository, and you want to put an existing project into it and upload that project to bitbucket.

You can copy/move your existing project into your local repo, then use your chosen system's tools to add all the files to the local repo.

For Bitbucket, you want to create a new private repository. In the "Get Started" area, there is a link "I have an existing project to push up" that will give you command line instructions on how to push your existing repository to bitbucket.

Sascuash Kirtash March 31, 2014

I have no local repo, I want to make my proyect become a repo that I can upload to bitbucket while keeping it private.

Notice this is my very first time using bitbucket

0 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2014

Git or Mercurial?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events