colonelpanic8 / github-clone.el

Fork and clone Github projects from Emacs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

github-clone.el

Introduction

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

http://melpa.org/packages/github-clone-badge.svg https://travis-ci.org/dgtized/github-clone.el.png?branch=master

Usage

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.

Install

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 https://raw.githubusercontent.com/dgtized/github-clone.el/master/github-clone.el

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.

[github]
  user = $USER
  oauth-token = $KEY

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

[include]
  path = ~/.gitconfig.private

About

Fork and clone Github projects from Emacs


Languages

Language:Emacs Lisp 94.4%Language:Makefile 5.6%