Skip to content

Git

Installation

sudo apt install -y git

GitHub CLI Installation

type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y

Authentication

Enable the credential.helper
git config --global credential.helper "store --file ~/.git-credentials"

The credentials get saved after the first login

Enable the credential.helper
git config --global credential.helper
Enable credential storing
git config --global credential.helper 'cache --timeout=86400'
Enable credential storing
git config --global credential.helper 'cache --timeout=604800'
  1. Add SSH key in Gitea web interface

  2. Add SSH config entry

    ~/.ssh/config entry
    Host gitea
        HostName gitea.local
        Port 222
        User git
    
  3. Test connection

    Test connection
    $ ssh gitea
    PTY allocation request failed on channel 0
    Hi there, john! You've successfully authenticated with the key named john@appdaemon, but Gitea does not provide shell access.
    If this is unexpected, please log in with password and setup Gitea under another user.
    Connection to gitea.local closed.