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

3.8 KiB

eleventyNavigation
key title parent order
InstallGit Install Git GettingStarted 50

Codeberg is based on the Git version control system. This is why you should install Git.

Git runs on every OS. You can download it directly from the Git website.

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.

Windows 10

There are several possiblities to install Git on Windows. The easiest (IMHO) is shown here.

Admin or user?

For some Git clients (see below) and some cases, it is recommended to install Git as administrator on your machine. It is also possible to install as user, but this might need some extra configuration steps later.

Install

If you want to install as user, just log in with your user account and run the installer.
To install with adminitrator 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

Follow the steps. If you are not an expert, just accept the defaults.
There are two steps for which you have to pay attention:

  1. Choose your editor:
    win-editor

  2. PATH environment:
    win-path Make sure that Git can be used by 3rd party software (Git clients). It is recommended (and the default) anyway.

This is surely not quite normal, but everytime I install it, I get an error at the end that it cannot display the release notes:
win-error
You can safely ignore this error. You can find the release notes in Start Menu > Git > Git Release Notes.

Run

Windows is special (and not in a good way) when it comes to the shell.
Git can be used through the Command Prompt (the native 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

Git is now installed and running, but you need to connect it to Codeberg. This is easily done with Git Bash:

git config --global user.name 'PolarBear'
git config --global user.email 'polarbear@example.com'
git config --global --list

The username can be anything, but it is important that the email is the same as the one you use on Codeberg.

The first time you push/pull (see Clone & Commit via HTTP), it 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.

macOS

Instructions will be added soon!

Linux/Unix

Instructions will be added soon!

Git clients

Git can be used with command lines as shown above, but it can also be used through so-called Git clients. A list (sample?) of them can be found on the Git website.