Written by Peter Bui Follow on
Published: 12 September 2014

This video takes you through how we setup our projects at PB Web Dev into a git repository and hosting it on BitBucket. The application that we are using to manage the project is called SourceTree. It is another application and offering from the company called Atlassian who provide software development tools for small to large companies around the world. We've fallen in love with the suite of tools that Atlassian provide and this video shows how we use them and set them up for our team members.

This video goes through specifically how to put code from a working project into BitBucket and managing it all via SourceTree. It assumes that you have git, and SourceTree all configured and installed on your computer ready to go.

Create your Bucket

The first step is to create a repository in BitBucket to place your code into and share with others.

Initialise Your Project to Work with git

Before you can continue, you have to make sure that your project is being tracked and version controlled by git.

Use the command

"git init"

in the folder of your code to initialise git to start tracking your code and repository.

Add a Working Copy in SourceTree

Navigate to SourceTree and Add a Repository. 

Choose the option to create Add a Working Copy

Browse to the folder where you previously had initialised to git and where your code is residing on your computer.

Add in Your Remote Repository

Now you can copy in the URL of your BitBucket repository to your SourceTree tool.

Choose Repository from the menu and choose "Add repository". Here you can either browse to your online repositories that are on BitBucket or enter in the URL with your username directly into the URL field.

Fill in any other credentials that you may need and continue.

Stage and Commit Your Code

Now that your repository is completely setup, you can stage the code that you want to track. This tells SourceTree/git what code you want to monitor and what you don't want to monitor and share.

Stage all the code that you need and ignore the code that you don't.

Push Your Commit

Now that you have committed code. You need to push that to the remote repository. 

Choose the commit that you want to push and click the push icon to push the code to the remote repository. 

Navigate in your web browser to the BitBucket repository to see if your code has been successfully committed and pushed.


Peter Bui

Peter Bui

An all round web specialist with years of experience in web design, development and open source solutions at PB Web Development

Subscribe to the Podcast

Subscribe to Newsletter

Stay up to date with the latest Joomla news, design, development, marketing and management hints and tips right in your email.

Setting up git, BitBucket, SourceTree & a Workflow | Videocast - Joomla Beat Podcast