GitHub Desktop is a popular graphical interface that simplifies the management of Git repositories, making it easier for developers to collaborate and manage code. It provides a user-friendly way to clone repositories, create branches, commit changes, and push updates to GitHub, all without needing to use the command line. GitHub Desktop is especially useful for developers who prefer a visual interface for Git operations.
On Debian 12 or 11, GitHub Desktop can be installed using the Shiftkey GitHub Desktop Linux project. This project offers two main installation methods: manually downloading and installing the .deb package or adding the project’s local APT repository mirror for quicker and easier updates. This guide will walk you through both installation methods, allowing you to choose the one that best fits your development workflow.
Method 1: Install GitHub Desktop via .deb Package
While GitHub officially supports only Windows and macOS, Linux users can access the platform through the “shiftkey/desktop” project. This fork provides Linux-compatible packages for various distributions, including Debian.
To start, visit the releases page and download the most recent release. Although this guide focuses on installing the “.deb” package, you can also choose the AppImage if you prefer and are familiar with it.
Download the GitHub Desktop .deb file
Download the latest release using the following command in your terminal. This command fetches the .deb file from the GitHub repository and saves it to your local system:
wget https://github.com/shiftkey/desktop/releases/download/release-3.2.1-linux1/GitHubDesktop-linux-3.2.1-linux1.deb
Install GitHub Desktop on Debian via DPKG Command
With the .deb file downloaded, you can now install the GitHub Desktop application. Our guide uses version 3.2.1 RC1 as an example. Replace <filename> in the command below with the name of the .deb file you downloaded:
sudo dpkg -i <filename>.deb
Example with 3.2.1 RC1:
sudo dpkg -i GitHubDesktop-linux-3.2.1-linux1.deb
Note: Remember, this is just an example command; your installation command should be newer than “v3.2.1” version.
For newer Debian users who might not know, dpkg is a package manager used to install, remove, and manage Debian packages. It’s a fundamental tool for installing .deb packages on your system. The -i flag is a command option that tells dpkg to install the specified package.
Method 2: Install GitHub Desktop via APT PPA (Recommended)
The second approach to installing GitHub Desktop is through a third-party APT repository. This method is preferable as it enables easy updating of your GitHub Desktop application and other packages.
Two third-party APT repositories in the United States are mirrors for the shiftkey/desktop GitHub project. These repositories are endorsed and listed on the project’s page. However, some users in other parts of the world may experience difficulties connecting to a US mirror, although this is not expected to impact most users.
Update Debian Before Installation of GitHub Desktop
Before installing GitHub Desktop, ensure your Debian system is up-to-date by running the following command:
sudo apt update && sudo apt upgrade
This command updates the package lists and upgrades installed packages to their latest versions.
Install Initial Required Packages For GitHub Desktop
You’ll need to install some prerequisite packages to install a GitHub Desktop using an APT repository. Run the following command to install them:
sudo apt install wget software-properties-common
These packages must import the GPG key and add the repository to your system.
Import GitHub APT Repository
Choose one of the two available mirrors. It is recommended to use the first one, but you can opt for the second one if you encounter any issues.
Import GPG key and APT Repository from @shiftkey:
wget -qO - https://apt.packages.shiftkey.dev/gpg.key | gpg --dearmor | sudo tee /usr/share/keyrings/shiftkey-packages.gpg > /dev/null
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/shiftkey-packages.gpg] https://apt.packages.shiftkey.dev/ubuntu/ any main" > /etc/apt/sources.list.d/shiftkey-packages-desktop.list'
Alternative mirror by @mwt:
wget -qO - https://mirror.mwt.me/shiftkey-desktop/gpgkey | gpg --dearmor | sudo tee /etc/apt/keyrings/mwt-desktop.gpg > /dev/null
sudo sh -c 'echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/mwt-desktop.gpg] https://mirror.mwt.me/shiftkey-desktop/deb/ any main" > /etc/apt/sources.list.d/mwt-desktop.list'
Refresh APT Packages Cache After PPA Import
After importing one of the mirrors, run an APT update to ensure that the newly added repositories are recognized:
sudo apt update
Finalize Installation of GitHub Desktop via APT Command
To install GitHub Desktop, use the following command:
sudo install github-desktop
This command installs the GitHub Desktop application from the chosen repository.
Launch GitHub Desktop
After successfully installing GitHub Desktop on your Debian system, you can launch the application using either the terminal or the graphical user interface (GUI) method.
Firstly, to launch GitHub Desktop from the terminal, run the following command:
github-desktop
Alternatively, to launch GitHub Desktop using the GUI method, follow these steps:
- Open your system’s application menu. This menu is usually accessed via a button or icon on the taskbar or dock, such as the “Activities” button in GNOME or the application launcher in KDE Plasma.
- You can search for “GitHub Desktop” in the application menu by typing it into the search bar or browsing the list of installed applications.
- Click on the “GitHub Desktop” icon to launch the application.
Additional GitHub Desktop Commands
Update GitHub Desktop
Keeping your GitHub Desktop application up-to-date ensures you have the latest features, bug fixes, and security patches. The update process depends on the installation method you used earlier.
If you installed GitHub Desktop using the APT repository method, run the following commands to update your application:
sudo apt update
sudo apt upgrade
If you installed GitHub Desktop using the .deb file method, you must download the latest .deb file from the GitHub Desktop release page and repeat the installation process described in Method 1.
Remove the GitHub Desktop
If you ever need to uninstall GitHub Desktop from your Debian system, you can do so with the following command:
sudo apt remove github-desktop
This command removes the GitHub Desktop application from your system. Note that this command does not delete any repositories or Git-related data you’ve worked on using the application.
Conclusion
By installing GitHub Desktop on your Debian system using either the .deb package or the APT repository mirror, you gain access to a powerful and easy-to-use tool for managing Git repositories. The manual installation offers a straightforward setup, while adding the APT repository mirror allows for seamless updates, ensuring you always have the latest version of GitHub Desktop. Regular updates will help you stay on top of new features and improvements, making your development experience smoother and more efficient on Debian.