TechDocs/Git/FirstSteps

Guide: First steps with git.fsfe.org

First of all, you should log in on git.fsfe.org. Just use your Fellowship credentials and - tadaaa! - you are a new user on the FSFE's Git platform. At first, you might want to Explore what's already on git.fsfe.org by clicking on the button in the upper navigation bar: you'll see other users, their repositories and what they've been doing.

Before getting involved in some actions, have a look at your personal settings. You'll find them by clicking on your profile picture in the upper right corner. Your Profile brings you to your public profile page. Your Starred shows repositories that you favourited – a section which will be empty at first.

Your Settings will be most interesting for you. In the Profile tab, type in some personal information so other users can recognize you. Avatar enables you to change your profile picture which helps in issue discussion threads. Password is unavailable to you because the password is always the same as your FSFE account password. SSH/GPG Keys will be very important in the next step because they will enable you to authenticate via your computer's terminal (command line interface) as soon as you start making commits. The other tabs aren't relevant for you (yet).

SSH authentication

As soon as you're starting contributing to a repository by changing files, you should enable SSH authentication. SSH keys won't require you to type in your username and password each time you want to send a change from your computer to the server, and they're also helpful for other authentication purposes. Here's a short step-by-step list how to create and activate your own SSH key.

  1. Check whether you already have an SSH key: Type ls -al ~/.ssh in your GNU/Linux terminal. If id_rsa and id_rsa.pub appears, you already have a SSH key - continue with step 3.

  2. Generate a new SSH key by typing ssh-keygen -t rsa -b 4096 -C "username@fsfe.org". Omit typing in a password if you are sure that you can protect your SSH private key (it's like a house key!). If you set a password, consider using ssh-agent to avoid having to type in the SSH key's password each time you use it.

  3. Add the public SSH key to your account at git.fsfe.org: Copy the content of file ~/.ssh/id_rsa.pub into Your Settings > SSH/GPG Keys > Manage SSH Keys > Add Key > Content. Make sure to use the file ending with .pub, the one without it should be kept secret!

  4. Try to log in via your terminal with ssh git@git.fsfe.org. Your SSH client will ask you to verify the server's SSH host key if it hasn't connected to it before. You should only type 'yes' if the listed key fingerprint matches exactly the authoritative fingerprint listed below. After accepting, if the message from the server now reads "Hi there, You've successfully authenticated, but Gitea does not provide shell access.", you are talking to the server and git should be working!

If everything worked, you are now ready to work with repositories, either your own or those of other people/organizations you're allowed to edit.

Github.com hosts a more verbose introduction if something's unclear. But please make sure to replace github.com by git.fsfe.org on each occasion. Also, be aware that GitHub might be a little bit different than Gitea sometimes.

Authoritative SSH host keys

The SSH server at git.fsfe.org is configured with two SSH key pairs produced using the algorithms know as RSA and ED25519. Below are fingerprints (hashes) of the public keys of these pairs calculated using the current default hashing algorithm SHA256 (used in OpenSSH >=6.8) and the previously prevalent MD5 hash. Only one of these will match on connecting using a specific client, according to negotiation between client and server and the client's hashing abilities/configuration.

Key type

Hash type

Fingerprint

ED25519

SHA256

J1zvdJyvt5Dw5ktiX54/ABt4gH0T1kwgcgLN68HKq/U

RSA

SHA256

tYZDhMoTXp4EuSrkwKlOBVx50z/9Dl1D0RL2010kcgM

ED25519

MD5

ed:6b:5c:71:99:ce:67:6c:c0:c2:e6:26:73:d9:44:f0

RSA

MD5

62:10:2c:f2:bd:a0:46:24:df:7d:da:26:79:2f:7b:0d

Prepare Git on your computer

In order to push the changes from your computer to the git.fsfe.org server, you'll need some preparation. Of course, the necessary tools need to be installed, and we need to configure Git a little bit.

First of all, let's install git. For example, on Debian systems, do in your terminal:

sudo apt-get install git

Now, you should set some information about yourselve in your git client. This will help other people to correctly identify who has made changes to files. To do so, type in your terminal (of course with modified values):

git config --global user.name "Your Name"
git config --global user.email YourUsername@fsfe.org
git config --global push.default simple

The last line makes some commands easier to remember and type in. If you're an advanced user, you can of course ignore this line.

Special settings

If your username and mail on e.g. GitHub is different from the one on git.fsfe.org, move to the repository you want to have other settings with and leave away the --global part in the commands above.

TechDocs/Git/FirstSteps (last edited 2018-10-12 05:59:33 by georgebs)