Connecting Xed-Editor to Forgejo

By Christopher Burg

In my previous post I mentioned using Xed-Editor for notes on GrapheneOS, but not being able to use it for git operations because the credentials only worked for GitHub. It turns out I was wrong.

I use two-factor authentication on Forgejo (and every other website that supports it) so I can't simply enter my user name and password in Xed-Editor. However, Xed-Editor is smart enough to use access tokens to log into Forgejo. Connecting Xed-Editor to Forgejo is simple. First, you need to create an access token in Forgejo.

  1. Go to your user settings.

  2. Go to the Applications section.

  3. Click the New Access Token button. Make sure the token has read and write access under repository permissions.

  4. Click the Generate token button and take note of the generated access token. Once you navigate away from the screen, you won't be able to view the token again.

Then you simply add your user name and access token to Xed Editor.

  1. Go to Xed-Editor's settings.

  2. Tap on the Git section.

  3. Tap on Credentials.

  4. Enter your username in the Username field and access token in the Password field.

  5. Tap the Apply button.

I thought I had tried this before, but obviously I misremembered. I'm glad I figured this out too. Xed-Editor's git operations are significantly faster than GitSync's. In fact, I took a second look at figuring out how to connect Xed-Editor to my Forgejo server because GitSync has been acting more inconsistent over time. I haven't had enough time to figure out exactly what's going on, but as my notebook has grown, the amount of time it takes to do commits has increased. The last commit I tried never succeeded because I couldn't stage the files (the commit screen just showed the loading indicator). It's also inconsistent about picking up local changes made in other applications like Xed-Editor whereas Xed-Editor has no problem picking up changes made by GitSync.