Difference between revisions of "Github"

From WikEmacs
Jump to navigation Jump to search
(→‎Integration into Magit: Forge superseeds magithub)
 
(14 intermediate revisions by 2 users not shown)
Line 1: Line 1:
What are the packages and libraries that allow us to interface with github (and gitlab, and others) ?
+
What are the packages and libraries that allow us to interface with Github.
 +
 
 +
See also the [[Gitlab]] page.
 +
 
 +
If you want to see packages to interfere with Git, see its own [[git]] page, and of course [[Magit]].
  
 
= Packages =
 
= Packages =
  
== Github only ==
+
== Integration into Magit ==
 +
 
 +
[https://github.com/vermiculus/magithub/ Magithub] was a popular package to interact with Github directly from Magit. This functionality is integrated into Magit since december, 2018, via the Forge package. We can create a repository, manage pull requests, create issues and more. See the [[Magit]] page or the [https://magit.vc/manual/forge/ Forge manual] to getting started.
 +
 
 +
Submitting a PR in magithub:
 +
 
 +
[[File:Magithub-pull-request.gif]]
  
=== Repo interaction ===
+
== Repo interaction ==
  
[https://github.com/dgtized/github-clone.el github-clone] gives an interactive function to fork and clone github projets from emacs.
+
[https://github.com/dgtized/github-clone.el github-clone] gives an interactive function to fork and clone github projets from within emacs. The command {{Command | github-clone}} will prompt for a repository and directory to clone to. In one shot, it will use the github api to fork the repo if you are not the owner, clone the repo to the specified directory, and add a remote called upstream if the repository is a fork.
  
=== Gist interaction ===
+
== Gist interaction ==
  
 
[https://github.com/mhayashi1120/yagist.el yagist], "yet another emacs integration for gist.github.com" does what it is meant for. It gives functions to list gists, create public or private gists from the region or the buffer, etc.
 
[https://github.com/mhayashi1120/yagist.el yagist], "yet another emacs integration for gist.github.com" does what it is meant for. It gives functions to list gists, create public or private gists from the region or the buffer, etc.
  
=== Pull requests ===
+
== Pull requests ==
  
 
[https://github.com/sigma/magit-gh-pulls magit-gh-pulls] is a [[magit]] extension that allows you to conveniently manipulate Github’s pull requests from Emacs. It creates a new section called "Pull requests" in the magit status buffer. From there you can see the commits of the PR, create a topic branch or merge it. You can also create a new PR.
 
[https://github.com/sigma/magit-gh-pulls magit-gh-pulls] is a [[magit]] extension that allows you to conveniently manipulate Github’s pull requests from Emacs. It creates a new section called "Pull requests" in the magit status buffer. From there you can see the commits of the PR, create a topic branch or merge it. You can also create a new PR.
  
=== Issues ===
+
With [https://github.com/charignon/greview greview] we can review them.
 +
 
 +
== Get opened issues, insert when typing "Fixes #" in a commit message ==
  
[https://gitlab.com/emacs-stuff/git-commit-insert-issue git-commit-insert-issues] gives a minor mode and an interactive function to fetch the list of issues of the project, display them with [[helm]] and insert its title in the commit message.
+
[https://gitlab.com/emacs-stuff/git-commit-insert-issue git-commit-insert-issues] gives a minor mode and an interactive function to fetch the list of issues of the project, display them with [[helm]] and insert its title in the commit message. It also works with Gitlab.
  
 
[[File:git-commit-insert-issues.png]]
 
[[File:git-commit-insert-issues.png]]
  
=== Misc ===
+
== Misc ==
  
 
==== Open current file on github ====
 
==== Open current file on github ====
  
This is what does [https://github.com/osener/github-browse-file github-browse-file].
+
There few repos doing pretty the same action: [https://github.com/osener/github-browse-file github-browse-file], [https://github.com/rmuslimov/browse-at-remote browse-at-remote]
  
==== Helm ====
+
==== Helm to open a github page ====
  
 
[https://github.com/syohex/emacs-helm-open-github emacs-helm-open-github] groups utilities to open a github page. It deals with issues, commits, files, pull requests. It is based on the gh.el library.
 
[https://github.com/syohex/emacs-helm-open-github emacs-helm-open-github] groups utilities to open a github page. It deals with issues, commits, files, pull requests. It is based on the gh.el library.
Line 37: Line 49:
 
Do that with [https://github.com/Sliim/helm-github-stars helm-github-stars].
 
Do that with [https://github.com/Sliim/helm-github-stars helm-github-stars].
  
== Gitlab only ==
+
= Libraries =
  
=== gitlab.el ===
+
== gh.el ==
  
With [https://github.com/nlamirault/emacs-gitlab gitlab] we can fetch issues and projects with a [[Helm]] interface. It is also a client to gitlab's api.
+
[https://github.com/sigma/gh.el gh.el] offers endpoints to connect to github's api: get issues, repositories, gists, orgs and pull requests.
 +
 
 +
== github-issues.el (deprecated in favor of gh.el) ==
 +
 
 +
[https://github.com/inkel/github-issues.el github-issues.el] (not in melpa) allows to fetch github issues. It's deprecated in favor of gh.el. It had limitations that are not going to be fixed (like, connection to private repos).
 +
 
 +
== ghub, a minuscule github api client ==
  
= Libraries =
 
  
== gh.el ==
+
See [https://github.com/tarsius/ghub ghub.el].
  
[https://github.com/sigma/gh.el gh.el] offers endpoints to connect to github's api: get issues, repositories, gists, orgs and pull requests.
+
= See also =
  
== github-issues.el ==
+
== Magit ==
  
[https://github.com/inkel/github-issues.el github-issues.el] (not in melpa) allows to fetch github issues.
+
[[Magit]], a git interface.
  
 +
== VC, the built-in version control ==
  
== emacs-gitlab ==
+
It's built-in. You can read [https://www.gnu.org/software/emacs/manual/html_node/emacs/Version-Control.html its official documentation online].
  
[https://github.com/nlamirault/emacs-gitlab gitlab.el] is a rest client to gitlab's API.
+
[[Category:Package]]
 +
[[Category:Version Control]]

Latest revision as of 15:00, 28 May 2019

What are the packages and libraries that allow us to interface with Github.

See also the Gitlab page.

If you want to see packages to interfere with Git, see its own git page, and of course Magit.

Packages

Integration into Magit

Magithub was a popular package to interact with Github directly from Magit. This functionality is integrated into Magit since december, 2018, via the Forge package. We can create a repository, manage pull requests, create issues and more. See the Magit page or the Forge manual to getting started.

Submitting a PR in magithub:

Magithub-pull-request.gif

Repo interaction

github-clone gives an interactive function to fork and clone github projets from within emacs. The command M-x github-clone will prompt for a repository and directory to clone to. In one shot, it will use the github api to fork the repo if you are not the owner, clone the repo to the specified directory, and add a remote called upstream if the repository is a fork.

Gist interaction

yagist, "yet another emacs integration for gist.github.com" does what it is meant for. It gives functions to list gists, create public or private gists from the region or the buffer, etc.

Pull requests

magit-gh-pulls is a magit extension that allows you to conveniently manipulate Github’s pull requests from Emacs. It creates a new section called "Pull requests" in the magit status buffer. From there you can see the commits of the PR, create a topic branch or merge it. You can also create a new PR.

With greview we can review them.

Get opened issues, insert when typing "Fixes #" in a commit message

git-commit-insert-issues gives a minor mode and an interactive function to fetch the list of issues of the project, display them with helm and insert its title in the commit message. It also works with Gitlab.

Git-commit-insert-issues.png

Misc

Open current file on github

There few repos doing pretty the same action: github-browse-file, browse-at-remote

Helm to open a github page

emacs-helm-open-github groups utilities to open a github page. It deals with issues, commits, files, pull requests. It is based on the gh.el library.

Browse your starred repos with Helm

Do that with helm-github-stars.

Libraries

gh.el

gh.el offers endpoints to connect to github's api: get issues, repositories, gists, orgs and pull requests.

github-issues.el (deprecated in favor of gh.el)

github-issues.el (not in melpa) allows to fetch github issues. It's deprecated in favor of gh.el. It had limitations that are not going to be fixed (like, connection to private repos).

ghub, a minuscule github api client

See ghub.el.

See also

Magit

Magit, a git interface.

VC, the built-in version control

It's built-in. You can read its official documentation online.