Search
Close this search box.

Git Blog

Releasing the Power of Git

gitlab-client-linux

GitLab Client for Linux

This article was written by a guest author.

GitKraken Git client and GitLab == a pair made in heaven

Working in a DevOps field, I often find myself needing to deliver a feature or an improvement (basically a piece of code) in a relatively short amount of time, or even working in parallel on different tasks.

A rather universal software development stack is comprised of:

  • a Linux environment
  • a version control system (usually Git)  and a Git client (like the GitKraken Git GUI)
  • a platform which offers some continuous integration and deployment features (GitLab in this case)

Repository and branch management in Git has never been easier. Get more control over your Git workflow with the visualization offered by GitKraken.

Repository Management in Git

In the beginning, it might not seem like something difficult to manage, but as the number of projects begins to grow and the technology stack differs from project to project, maintaining and working with various types of setups tends to become rather demanding to manage, even for an experienced software engineer.

For beginners, this situation can be quite daunting. Even though I’m a big CLI fan, I can honestly admit that I’ve been stuck in repository hell, with endless Git repositories, remote branches and dependencies.

Remote branches in the terminal

A Git Client to Manage GitLab Repositories

This was the moment when I knew that I needed a Git client. After trying multiple variants, the one that I felt most comfortable with was GitKraken, and the best thing is that it doesn’t need any dependencies (not even Git); it just works directly with your GitLab repositories. Additionally, GitKraken is one of the few Git clients to support Linux.

The first thing that caught my attention was GitKraken’s intuitive layout. One concrete example being the possibility to see all remote branches and the ease with which you can checkout remote Git branches.

One of the mundane tasks when working within a distributed environment is the Git SSH key setup. Keeping track of SSH keys and adding them to remotes is usually one of the very first tasks for newcomers on a team, which sometimes can be cumbersome for beginners.

SSH key setup in the CLI

GitKraken easily solves this problem by providing a seamless integration with GitLab; no need to use ssh-keygen, copy the public key to your remote repository, or manage ~/.ssh/config. The GitLab SSH key configuration is fully managed within GitKraken.

SSH-key generation

GitLab Pull Requests

Another cool feature that really speeds up the development process is the possibility to quickly create GitLab pull requests within the GitKraken Git GUI on Linux.

For a new feature, usually the process consists of creating a new Git branch (frequently from the development branch), adding the desired modifications, pushing the branch to your remote, followed by a merge request.

All these tasks can be performed in a matter of seconds from the Git client just by dragging and dropping one branch on the other and then selecting Start a pull request. Merging branches on your local machine using GitKraken has the same process, just drag and drop.

Starting a pull request in GitKraken

As long as you’re connected to a GitLab remote repository, you can manage your Git pull requests conveniently from one place directly in the Git client on Linux.

PR request creation in GitKraken

GitKraken’s pull request functionality has such a good integration with GitLab that it even allows the user to open and view the pull request in GitLab by opening a new tab in the browser with GitLab’s merge request view. GitKraken’s GitLab integration provides a seamless experience across all operating systems, including Linux.

Pull Request view

GitLab Issues

GitKraken also offers a feature for GitLab Issues which enables the team to collaborate and plan work using a Git client on Linux.

Setting GitLab as default issue queue

GitKraken fully supports an integration with GitLab Issues by allowing users to view, update, add comments for a certain Gitlab Issue, and also create a branch tied to that specific issue.

GitLab issue open in GitKraken

GitKraken is the only Git client to offer issue tracking integrations. This allows you to reduce context switching, saving you precious coding time.

Undo Git Mistakes in the Command Line

Last but not least, one of the knottiest problems when it comes to Git is the process of undoing an action.

From a high level perspective, Git “works” with the following three main namespaces/areas:

  • Working directory (“untracked” area)
  • Index (staging area)
  • Local repository (everything under .git directory)
graph moving through the he git workflow of working directory, staging area and repository

So let’s say that you want to undo a recent change that you made, like undo a Git commit for example. While this might seem to be a straightforward process, some challenges will arise, like which state the changed file is in? Do we want to undo all changes? For a fairly simple use case, like updating a file (e.g. Dockerfile), some commands need to be executed.

Lifecycle of a file

So what happens if we want to undo the changes which have been made to our Dockerfile? Technically, we will need to undo our local work, more exactly undo the last commit, and unstage the file in order to modify it.

This can be achieved using the following commands in the CLI: 

git add <FILE>

git commit -m '<COMMIT MESSAGE>’

git reset --soft HEAD^1

git reset HEAD <FILE>  

git checkout -f <FILE>
Unstaging the file

These commands are required for preparing the file for a commit and subsequently bringing it back to the working area.

Not to mention that the latter commands are interspersed with the git status command (to display the state of your areas). The previous scenario is actually quite an easy one due to the fact that only one change is being made in one file. This still requires the execution of five commands in the CLI. 😰

Undo Git Mistakes in 1 Click with a Git Client

If we were to do the same scenario using the GitKraken Git client with GitLab on Linux, it would be an effortless action and needless to say that we would have a visual representation of all the Git areas. It is easier to follow the status of the file, and the degree of flexibility will be even greater in the case of multiple changes in multiple files.

Undoing a commit in GitKraken

Git Client for GitLab and Linux

As I used GitKraken more and more, I discovered that it’s more than a GUI; it’s a fully fledged tool that provides a way to increase efficiency through intuitive design and seamless integrations. It’s designed in such a way that helps the user to make sense of Git and enables a fluid workflow.

GitKraken’s Undo/Redo gives you more control over advanced Git actions, making them more secure while giving you peace of mind.🧘‍♂️

Like this post? Share it!

Read More Articles

Make Git Easier, Safer &
More Powerful

with GitKraken
Visual Studio Code is required to install GitLens.

Don’t have Visual Studio Code? Get it now.