Documentation/content/getting-started/install-git.md

70 lines
3.8 KiB
Markdown
Raw Normal View History

2020-09-22 14:29:00 +00:00
---
eleventyNavigation:
key: InstallGit
title: Install Git
parent: GettingStarted
order: 50
---
Codeberg is based on the [Git](https://git-scm.com/) [version control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) system. This is why you should install Git.
Git runs on every OS. You can download it directly from the [Git website](https://git-scm.com/downloads).
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](/assets/images/getting-started/install-git/Win_run-as-admin.PNG)
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](/assets/images/getting-started/install-git/Win_editor.PNG)
2. PATH environment:
![win-path](/assets/images/getting-started/install-git/Win_PATH.PNG)
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](/assets/images/getting-started/install-git/Win_error-notes.PNG)
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`:
```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](content/git/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](https://support.microsoft.com/en-us/help/4026814/windows-accessing-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](https://git-scm.com/downloads/guis).