People may wonder why oh-my-github since there are alternatives(Forge) exist, here are my answer in this Reddit thread:
oh-my-github’s Emacs interface require nothing but Emacs(28+), so this maybe its one advantage(or disadvantage 🤔).
All that said, oh-my-github is not only designed for Emacs, it’s designed as a generic framework for working with GitHub API.
oh-my-github’s core is written in C, so other language may use it as a library via FFI, I plan to improve CLI interface in future.
Hope this explain what oh-my-github’s design principle is, and why it exists besides X/Y/Z.
- Download omg.el
- Download required shared object, and rename it to
omg-dyn.so
ordll
suffix if you are on Windows- From release page according to your operating system
- or you can build it yourself with
make install-deps emacs-dyn
- Put above
el
andso
files underload-path
- Generate Github personal access tokens at https://github.com/settings/tokens and set it to
omg-pat
, or add this to your auth-source for better security.machine api.github.com login ${github-username}^omg password ${token}
- Set github username, you can do this in two ways:
- Set
omg-username
variable, or - Update git config by execute
git config --global github.user ${USER}
- Set
- Initialize with
omg-setup
Here is a use-package
config demo:
(use-package omg
:load-path "/path/to/oh-my-github/emacs"
:config
;; If you set token in auth-source, then you don't need to set this.
(setq omg-pat "${YOUR-TOKEN}")
(omg-setup))
After setup, you can
- Check authentication with
omg-whoami
- Sync repositories/gists with
omg-sync
~/.emacs.d/omg.db
is the default database file, users can customize it withomg-db-file
variable.
There are three major-modes for repositories: omg-repo-mode
, omg-repo-starred-mode
, omg-trending-mode
, and three derived modes:
omg-commit-mode
, commits of a repositoryomg-release-mode
, releases of a repositoryomg-release-asset-mode
, asset files of a release
As for gists, there are mainly two modes:
omg-gist-mode
, manage your ownned gistsomg-gist-starred-mode
,manage your starred gists
The figure below shows relations among them:
omg-sync
Sync repositories/gists- Since v0.4.0, synchronization happens in background thread, which will not hang Emacs any more. Users can check
*omg-log*
buffer for progress.
- Since v0.4.0, synchronization happens in background thread, which will not hang Emacs any more. Users can check
omg-repo-list-created
, list ownned repositoriesomg-repo-list-starred
, list starred repositoriesomg-gist-list-created
, list ownned gistsomg-gist-list-starred
, list starred gistsomg-trending-list
, list trending repositoriesomg-whoami
, fetch user informationomg-pull-create
, create a pull request. See this blog post to check details.#+TITLE: Awesome title #+TARGET-REPO: upstream/foo #+TARGET-BRANCH: main #+SOURCE-HEAD: my:main #+DRAFT: false