There is a lot of benefits in using Sourcetree with Bitbucket. The application can help you to synchronize your changes and it has complete access control to protect your repository. It also has built-in support for SourceTree's own Mercurial hosting service, allowing you to work off-line or to participate in distributed version control systems.
Bitbucket is a Git repository management system that is web-based. It is a program like Github but more flexible with unique features in it. It is a system which organizes all of your Git repositories and guide and develops your source code. It has some awesome and unique features built-in. Also, you can import your code from Git, CodePlex, Google Code, SourceForge, and even from SVN. It is free to use up to 5 users or for small teams. Bitbucket comes from Atlassian which also has commercial accounts for use in a big team or systems.
Sourcetree is a Bitbucket tool that is used as a git client and it’s free. It supports both windows and mac. In this article, I’ll show how to use Sourcetree with Bitbucket.
Before You Get Started
You need to ensure a few things before you start using Sourcetree with Bitbucket. So please follow the instruction below for removing any interruption in this process:
- Ensure you have a Bitbucket ID open. If not go to the https://bitbucket.org/ site and create a new id and start the work.
- You need some active works, codes, or repositories to download them. If not please create a sample project or new work.
- You need to know how to create a repository and clone them in Bitbucket.
- Download Sourcetree app for windows or mac from this link https://www.sourcetreeapp.com/
- Install the Sourcetree app properly.
Using Sourcetree with Bitbucket
Follow the below steps for using Sourcetree with Bitbucket:
- First, log in to your Bitbucket id by providing proper credentials from the https://bitbucket.org/ site.
- From your work select the Repository you want to clone from the Recent repositories list. You need to clone the repository for working with it in the Sourctree app.
- After clicking on the repository you want to clone you’ll find a Clone option in the top right corner. Click on the option to proceed with the cloning process.
- Now from the Clone this repository option Click on the Clone in Sourcetree option. But remember for this option to work you need Sourcetree installed in your system.
- Now from the prompt if you have Sourctree installed click on the Open Sourcetree option.
- Now your Bitbucket repository will open in the Sourcetree app, and from here you can select the location you want to clone the repository in your local drive and click on the Clone button.
- After completion of the cloning process, You can find the repository in your selected folder and you can make changes and click the Commit button in the top corner. You can add commit descriptions and check “Push changes immediately to origin/master”. By clicking the commit button changes will also be made in the remote bitbucket repository server too.
So this is how easily you can use Sourcetree with the Bitbucket server. Be careful about Commit of new changes because it will also make changes to your Bitbucket server.
Summary: How to use Sourcetree with Bitbucket?
- Bitbucket is more than just Git code management. Bitbucket gives teams one place to plan projects, collaborate on code, test and deploy, all with free private Git repositories. Teams choose Bitbucket because it has a superior Jira integration, built-in CI/CD, & is free for up to 5 users.
- To get started with using Sourcetree and Bitbucket, you need to register for a Bitbucket account.
- After registering for the account, now you need to create a repository inside your Bitbucket server.
- Sourcetree allows us to set up and manage multiple git repositories from within the app. It supports GitHub, BitBucket and GitLab as well as any other Git or Mercurial based repositories.
- Every time I try to push my code to the repository, it asks me for username and password rather than giving authorization error. This is due to version 2.0 of Sourcetree not remembering authentication information anymore issue which is already resolved in version 2.1 and above.