Forge

Table of Contents

1. Description

Forge allows you to work with Git forges, such as Github and Gitlab, from the comfort of Magit and the rest of Emacs.

Ghub is an Emacs library that is used by various packages to access the APIs of various instances of various Git forge implementations.

2. Setting the username

To inform Ghub about your username

git config --global github.user USERNAME

If you need to identify as another user in a particular repository, then you have to set that variable locally:

cd /path/to/repo
git config --local github.user USERNAME

3. Creating a token

Token example

machine api.github.com login USERNAME^forge password 012345abcdef...

4. Storing a token

Add the token to ~/.authinfo and encrypt it using GnuPG, remove the unencrypted file afterward

gpg -c ~/.authinfo

Explicitly set ~/.authinfo.gpg as the only file for auth-sources

(setq auth-sources '("~/.authinfo.gpg"))

5. Initial pull

6. References