These instructions are based on this article: https://www.alexruf.net/2016/05/23/setup-gogs-git-service.html.
Setup Raspberry Pi with minimal Raspbian image. You need to connect to the HDMI port and set the following:
sudo raspi-config
There you need to enable the SSH server and you should change the hostname.