Documentation/content/getting-started/install-git.md
2020-10-04 20:44:27 +02:00

5.8 KiB
Raw Blame History

eleventyNavigation
key title parent order
InstallGit Install Git GettingStarted 25

Projects on Codeberg use Git as their version control system. If you want to contribute sourcecode, it is a good idea to install Git at this point.

Git runs on every OS. You can download it directly from the Git website, or from your operating systems package manager (if available).

Here we provide step-by-step instructions to install it.
Disclaimer: we try to keep these instructions up-to-date, but you might need to adjust them to your machine/OS.

Linux

On Linux, you can install Git directly from your package manager. Check out Git's official documentation for the right command for your distro.

Please see also the article Configuring Git, which describes how to set up your name and email address for Git.

macOS

There are several possibilities to install Git on macOS. This guide will show you how to install Git using the Homebrew package manager. You will need to be on macOS High Sierra (10.13) or higher.

Install

You will first need to install Homebrew. You can do this following the instructions on their website.

Once you've installed Homebrew, you can install Git from your terminal using the following command.

% brew install git

Update

To update Git, run the following command.

% brew upgrade git

Configure

You now managed to get Git up and running. Please proceed as described in the article Configuring Git to set up your name and email address for Git.

Windows 10

There are several possibilities to install Git on Windows. An easy one is to use Gits install wizard, shown here.

Admin or user?

For some Git clients (see below), e.g. RStudio, it is recommended to install Git as administrator on your machine. It is also possible to install as regular user, but you might have to manually specify the path to the Git executable in the settings of your Git client.

Install

If you want to install as regular user, just log in with your user account and run the installer.
To install with administrator rights, either log in as administrator, or run the installer as administrator. In the latter case, right-click on the installer, select Run as administrator and enter your credentials:

win-run-admin

From there, follow the steps in the setup wizard. It is okay to just accept the defaults, when in doubt.
There are two steps for which you have to pay attention:

  1. Choose your editor:
    By default, Vim will be used for Git. But if you prefer to use another one, select it here.
win-editor
  1. PATH environment:
win-path

This makes sure that Git can be used by 3rd party software (Git clients). It is recommended (and the default) anyway.

You may get the error message displayed below, that the release notes cannot be displayed. That error message can be safely ignored. You can find the release notes in Start Menu > Git > Git Release Notes.

win-error

Run

Git can be used through the Command Prompt (the traditional Windows command line interpreter), the Windows Powershell (the "replacement" of the Command Prompt), the interface of your Git client, or Git Bash. The latter two options are recommended.

Git Bash is what comes with your Git installation. You can access it from the Start Menu: Git > Git Bash.

Configure

You now managed to get Git up and running. Please proceed as described in the article Configuring Git to set up your name and email address for Git.

Note that the first time you push/pull (see Clone & Commit via HTTP), Git will ask for your Codeberg credentials. If you did not change this setting during installation, these credentials will be saved by Windows in its Credential Manager. This is also where you have to go in order to change them.

Update

To update Git, the easiest way is to download and run the latest version of the installer and follow the previous steps. Make sure that you run the new installer with the same rights (administrator or user) as for the original installation. If not, it will be installed twice and that will create a mess.
If you want to keep all your settings, simply tick the box Only show new options in the installation wizard (see screenshots above). Here, "new options" refer to the options that were not available in the previous version.

Git clients

Git can be used from the command line as shown above, but it can also be used through graphical user interfaces called Git clients.
You can find a list of some of the available Git clients on the Git website.