Wine is the solution that we can use to install the SourceTree software on Linux systems including Ubuntu. Here is the tutorial to learn the steps we need to follow to get this free Git Client software.
Sourcetree is a popular but free client software to manage repositories based on Git and Mercurial. However, it is not available for Linux and works only for Windows and Mac.
The graphical interface of this client software is designed to simplify the Git and Mercurial version control systems. It is the GUI and clean navigation that makes SourceTree easier for software developers to manage their source code repositories and collaborate with their development teams.
Apart from this other common tasks can be performed using the SourceTress such as creating repositories, pushing and pulling changes, and working with branches.
Before you start the installation process, you will need to make sure that you have the following prerequisites:
- A system running Ubuntu Linux
- A user account with sudo privilege
Note: This tutorial is just for educational purpose and because of Wine we cannot assure that the software will work on Linux as it is natively for Windows or macOS
Step 1: Start with a System update
We should first run the system update command on our Linux to refresh the package manager index cache. So, open your command terminal and run the given command:
sudo apt update
Step 2: Install Wine on Linux
As we know SourceTree is not available for Linux, therefore to install it we are using Wine on Linux. As per the distro, the command to install it will be different. Here we are using Ubuntu 22.04, hence follow the tutorial we already have done for it: Steps to install Wine on Ubuntu 22.04 whereas Ubuntu 20.04 can use this link.
Yet, those who want to go through the commands quickly, here are they:
- Add 32-bit Arch support:
sudo dpkg --add-architecture i386
- For Ubuntu 22.04 LTS users only:
wget -nc https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
sudo mv winehq-jammy.sources /etc/apt/sources.list.d/
sudo mkdir -pm755 /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
- For Ubuntu 20.04 LTS users only:
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo add-apt-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
- Run system update
sudo apt update
- Installation command will be the same for both the versions
sudo apt install --install-recommends winehq-staging
Step 3: Download Sourcetree Package
The SoruceTree is not available as the Debian binary, so visit the official website of this Git Tool and download the Executable binary available for Windows.
Step 4: Use wine and run SourceTree
Once you have downloaded the file using the browser, it will be in the Downloads folder by default. Now, in your command terminal run the given command:
Alternatively, you can graphically open the Downloads folder from the file manager and right-click on the SourceTreeSetup-*.exe file to select “Open with other Application” then Wine Windows Program Loader.
Step 5: Installing SourceTree on Ubuntu
- Next, you will see the Installation Wizard of SourceTree. Those who want to connect the BitBucket can do it here. Otherwise, just press the Skip button because we can do this later as well.
- SourceTree supports Git and Mercurial, if you want to install any of them while installing the software, select the one and move forward. Learn – How to install Git on Almalinux or Rocky Linux 8
- The software will automatically pick the username, you can rename it.
- Once the installation is finished, you will see the SourceTree Desktop shortcut icon. Right-click it and select the “Allow Launching” option.
Soon the user interface of the SourceTree will appear. You can start using it. However, you may face a crashing problem.