Creating a Repository from an Online Source

I have a project on my own hosted domain (say,

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

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

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
Community showcase
Published Mar 14, 2019 in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder :  #!/bin/bash source "$(dirname "$0")/" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

291 views 0 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you