Git clients

You can use Git for version control through the command line or through a Git client. For the first option, see What is the Shell?. Here we are going to focus on Git clients.

Learning how and why to use Git can be rough. Therefore, using a client, rather than the command line, is usually helpful when getting started. Most clients help you interface with Git and GitHub through a user-friendly Graphical User Interface (GUI), but they still perform the same underlying Git commands that you would perform through the command line.

Git and a Git client are not the same thing, just like R and RStudio are not the same thing. A Git client and the RStudio are not necessary to use Git or R, but they make the experience more pleasant by reducing the steep learning curve.

RStudio incorporates a basic Git client. For simple operations such as committing and pushing changes to GitHub, this will be sufficient. We will be using the RStudio Git client in this course, which does not require further installation – just check everything works as expected by following the Using Git within RStudio instructions.

Once you start collaborating with other users, managing multiple branches in the same project, and performing complex merges, you will want another, more powerful Git client. At that point, it is also helpful, and sometimes necessary, to know how to use the command line.

Because all Git clients are just forming and executing Git commands on your behalf, you don’t have to pick a specific one. You can literally do one operation from the command line, do another from RStudio, and another from your Git client, one after the other, and it just works. Very rarely, both clients will scan the repo at the same time and you’ll get an error message about .git/index.lock. Try the operation again at least once before doing any further troubleshooting.

Recommendations for Git clients

Many users rely on the free GitHub client for Windows and Mac. However, the GitHub client offers lots of hand-holding. Perhaps too much. It also cannot handle complex Git operations, and installation of the GitHub client also includes a version of Git that does not play nicely with default settings. In addition, because it is intended to work with Git repositories hosted on GitHub, if you ever decide to share your repositories using an alternative hoster the GitHub client does not play nicely with outsiders.

If you want to use a Git client, here are some options to consider:

  • SourceTree - the pros are that it is free, multi-platform (Mac and Windows only, sorry Linux), powerful, and has a great GUI design. Some would complain that it is perhaps too powerful and its interface is overly complicated.
  • GitKraken - like SourceTree, GitKraken is free, powerful, and gets kudos for a great GUI layout. Unlike SourceTree, GitKraken is available across all major operating systems (Windows, Mac, and Linux).
  • TortoiseGit (Windows)
  • SmartGit (Windows, Mac, and Linux - free for non-commercial use only)
  • GitUp (Mac only)
  • Even more choices