Open In App

How to Install Sourcetree on Ubuntu

Last Updated : 14 Oct, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Managing repositories and tracking changes can sometimes be overwhelming, but with Sourcetree, developers can simplify version control and boost productivity. In this article, we will be installing the Sourcetree application on the Ubuntu system in a step-by-step process. 

What is Sourcetree?

Sourcetree is a GUI-based Git and Mercurial client application for managing and organizing repositories. Sourcetree provides a user-friendly GUI for performing various Git and Mercurial operations like pull, merge, commit, push, etc. Sourcetree application is open-source and available on various platforms including Windows, Mac, and Linux. Ultimately, Sourcetree is a powerful tool that enhances the productivity of developers and streamlines their workflow. 

Installing Sourcetree on Ubuntu

Follow the below steps to install the Sourcetree application on the Ubuntu system without facing any issues. 

Step 1: Update Your Ubuntu System

Firstly, update the system to refresh the package manager index cache. Execute the below command in the terminal to update the system using apt manager.

sudo apt update
Update Your Ubuntu System
 

Step 2: Install Wine on Ubuntu

As we know SourceTree is not directly available for Linux, therefore to install it we are using Wine on Linux. So using the below command, we can download Wine on the system. Run the command to install wine.

wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
Installing Wine on Ubuntu
Install Wine on Ubuntu

Step 3: Move Wine Configuration File to Sources Directory

After installing Wine, we will move the repository configuration file of Wine to the sources.list.d directory. 

sudo mv winehq-jammy.sources /etc/apt/sources.list.d/
Moving the Configuration file
Move Wine Configuration File to Sources Directory

Step 4: Create a Keyrings Directory

Now, we will create a keyrings directory with specific permissions. Execute the below command, to create the directory in the /etc/apt directory. 

sudo mkdir -pm755 /etc/apt/keyrings
Creating keyrings directory
Create a Keyrings Directory

Step 5: Download WineHQ GPG Key

Now, we will download the GPG key for the WineHQ repository and will save it in the keyrings directory that we have created in the above step. 

sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
Donwloading GPG Key
Download WineHQ GPG Key

Step 6: Install WineHQ Staging

By using the below command, we will install the WineHQ Staging package on the Ubuntu system along with the recommended packages that are needed for it to work properly. 

sudo apt install --install-recommends winehq-staging
Installing WineHQ Staging
Install WineHQ Staging

Step 7: Download Sourcetree for Windows

Visit the below site, to download the Sourcetree tool as it is not available as the Debian library, we will download the executable binary available for Windows.

https://www.sourcetreeapp.com/ 
Donwloading Executable Binary File
 

Step 8: Launch Sourcetree Installation Using Wine

After downloading the file using the web browser, it will be shown in the Downloads directory. We can launch the application for configuration from the terminal itself. Execute the below command in the terminal to launch the application for config.

wine ~/Downloads/SourceTreeSetup-*.exe
Launchigng the Application
Launch Sourcetree Installation Using Wine

Configuring Sourcetree on Ubuntu

After launching the installer, follow the steps below to complete the setup of Sourcetree on your Ubuntu system.

Step 1: Run the Sourcetree Installation Wizard

Once you have launched the application, you will see the Installation Wizard of Sourcetree as shown in the below screenshot. You can connect to the BitBucket otherwise, you can skip the process and move forward.

Registration Menu
Run the Sourcetree Installation Wizard

Step 2: Install Git and Mercurial Tools

As Sourcetree supports Git and Mercurial applications, we can install any of them or both. Just click on the tools to install and click Install. 

Downloading Version Control Systems
Install Git and Mercurial Tools

Step 3: Set Up Your Username

After downloading, you will see the success message as shown below screenshot. You can click on the Next button to set your username.

Tool Installation Completed
Set Up Your Username

Step 4: Finish the Installation

After clicking on the Next button, the application will choose an automatic username for you. You can rename the username as per your wish. After setting the username, you can click on Next to enter the application for usage. 

Adding Preferences
Finish the Installation

Step 5: Successful installation

Below you can see that, we have successfully installed and configured the Sourcetree application on Ubuntu without facing any error while installing. 

Using SourceTree Application

Conclusion

Although Sourcetree is primarily built for Windows and macOS, Linux users can still enjoy its benefits by using Wine. With Sourcetree, developers can manage version control, collaborate more effectively, and improve their productivity—all from a single, user-friendly application.


Next Article
Article Tags :

Similar Reads