TechDocs/Git/Guide: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 ~/ssh/id_rsa.pub in Your Settings > SSH/GPG Keys > Add Key (in the SSH section, not GPG). 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. If you read "Hi there, You've successfully authenticated, but Gitea does not provide shell access.", it's 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.

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/Guide:FirstSteps (last edited 2017-06-19 06:05:48 by max.mehl)