Open In App

How to Install Sourcetree on Ubuntu

Last Updated : 08 Jun, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

By using the Sourcetree application, developers can easily manage and organize their repositories, view the commit history, and track changes. The complex process of version control can be simplified by using this application. In this article, we will be installing the Sourcetree application on the Ubuntu system in a step-wise manner. 

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: 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
What is Sourcetree

 

Step 2: 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

 

Step 3: 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

 

Step 4: 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

 

Step 5: 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

 

Step 6: 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

 

Step 7: 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: 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

 

Configuring Sourcetree on Ubuntu

Step 1: 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

 

Step 2: 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

 

Step 3: 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

 

Step 4: 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

 

Step 5: 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

 



Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads