Skip to content
Fork and clone Github projects from Emacs
Emacs Lisp Makefile
Branch: master
Clone or download
Latest commit 467b40c Jun 22, 2016
Type Name Latest commit message Commit time
Failed to load latest commit information.
test Allow repo names with trailing slashes Jan 14, 2016
.gitignore Add test harness, Cask, and Makefile Aug 4, 2014
.travis.yml Travis appears to ignore emacs-lisp as a language Jul 6, 2015
Makefile Fix test-helper to be load-path aware Aug 4, 2014



Easily clone github repos, and optionally fork a copy with the remote named after the users github username.


M-x github-clone will prompt for a repository and directory and clone the repository as origin to that directory. It will then optionally fork the repo and add a remote named after the github user.

As example:

(github-clone "dgtized/github-clone.el" "~")

gh.el will prompt for a github username and password to generate an oauth key. See documentation on gist.el and GitHub API for more details.

After creating an API key, dgtized/github-clone.el will be cloned into $HOME/github-clone.el as remote origin. It will then prompt if the repository should be forked. If so, it will fork the repository to the user authorized by the API key. Finally a remote named after the github user will added to the local repository.


github-clone.el uses gh.el as a dependency, so it’s easiest to install via package.el.

Via Package.el

Using the MELPA package archive,

M-x package-install [RET] github-clone [RET]

Or manually by downloading github-clone.el,

$ wget

And then from emacs:

M-x package-install-file path/to/github-clone.el

GitHub API Keys

gh.el uses ~/.gitconfig to store the API keys. When the key is created it will store the key at the end of ~/.gitconfig.

Permissions and Revoking

If gh.el has trouble generating an API key, or it is necessary to revoke the API key, visit Application Settings. Generate a new personal access token with permissions for repo, and user. Include permissions for gist to maintain compatibility with gist.el.

Securing the keys

~/.gitconfig is a useful dotfile to version in a git repository. So how can we avoid storing API keys in the dotfile repo? Move the API configuration into ~/.gitconfig.private.

  user = $USER
  oauth-token = $KEY

Replace the API keys configuration in ~/.gitconfig with the inclusion below.

  path = ~/.gitconfig.private
You can’t perform that action at this time.