It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating a Repository from an Online Source

Mark Yorkovich Jun 27, 2013

I have a project on my own hosted domain (say, http://project.mydomain.com).

I created a repository in my BitBucket account, but I'm not sure what I need to do from there. How do I set up my online source code to push to the BitBucket repository?

I did go through most of the BitBucket101 tutorial, but either I went over it and it went over my head, or this specific situation isn't covered.

If instructions reference a specific interface, if possible, I'd appreciate it if I could do it in Tortoise Workbench - also, if instructions do exist, please let me know!

Your help will be greatly appreciated!

1 answer

0 votes
Marcus Bertrand Atlassian Team Jun 28, 2013

You can do this from the command line by doing the following:

In your project's source code directory, run

git init

This will create a new git repository in that directory. Then, you need to tell the new empty repository about your files.

git add -A

Of course, this will add every single file in the directory, which you probably don't want to do. To exclude files, like ones from your IDE or editor, create a gitignore file. Now that all your files are being tracked by Git, tell git to commit them.

git commit -m "Initial project setup in Git."

That will tell git to save a snapshot of all the files you told it to track. -m is to set the commit message. Now, it is time to push your changes from your local repository up to Bitbucket. First, add the URL to your repository to the 'origin' alias.

git remote add origin https://bitbucket.org/username/repo.git

And finally, push your code up to Bitbucket.

git push -u origin master

That will push your initial commit to Bitbucket. From there, when you make changes in your local directory, you always commit then push them up to Bitbucket. We don't have specific instructions for Tortoise, but I found this blog post that will probably help.

Suggest an answer

Log in or Sign up to answer
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,031 views 1 20
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you