howto-github.md

 1# How-to: Read/write offline Github issues with git-bug
 2
 3[git-bug](https://github.com/MichaelMure/git-bug) is a standalone distributed bug-tracker that is embedded in git. In short, if you have a git repository you can use it to store bugs alongside your code (without mixing them though!), push and pull them to/from a normal git remote to collaborate.
 4
 5<p align="center">
 6    <img src="../misc/diagrams/native_workflow.png" alt="Native workflow">
 7</p>
 8
 9Bridges with other bug-trackers are first-class citizen in `git-bug`. Notably, they are bidirectional, incremental and relatively fast. This means that a perfectly valid way to use `git-bug` is as a sort of remote for Github where you synchronize all the issues of a repository to later read and edit them and then propagate your changes back to Github.
10
11<p align="center">
12    <img src="../misc/diagrams/bridge_workflow.png" alt="Bridge workflow">
13</p>
14
15This has several upsides:
16- works offline, including edition
17- browsing is pretty much instant
18- you get to choose the UI you prefer between CLI, interactive terminal UI or web UI
19- you get a near complete backup in case Github is down or no longer fit your needs
20
21## Installation
22
23Follow the [installation instruction](https://github.com/MichaelMure/git-bug#installation). The simplest way is to download a pre-compiled binary from [the latest release](https://github.com/MichaelMure/git-bug/releases/latest) and to put it anywhere in your `$PATH`.
24
25Check that `git-bug` is properly installed by running `git bug version`. If everything is alright, the version of the binary will be displayed.
26
27## Configuration
28
291. From within the git repository you care about, run `git bug bridge configure` and follow the wizard's steps:
30    1. Choose `github`.
31    1. Type a name for the bridge configuration. As you can configure multiple bridges, this name will allow you to choose when there is an ambiguity.
32    1. Setup the remote Github project. The wizard is smart enough to inspect the git remote and detect the potential project. Otherwise, enter the project URL like this: `https://github.com/MichaelMure/git-bug`
33    1. Enter your login on Github
34    1. Setup an authentication token. You can either use the interactive token creation, enter your own token or select an existing token, if any.
351. Run `git bug bridge pull` and let it run to import the issues and identities.
36
37## Basic usage
38
39You can interact with `git-bug` through the command line (see the [Readme](../README.md#cli-usage) for more details):
40```bash
41# Create a new bug
42git bug add
43# List existing bugs
44git bug ls
45# Display a bug's detail
46git bug show <bugId>
47# Add a new comment
48git bug comment <bugId>
49# Push everything to a normal git remote
50git bug push [<remote>]
51# Pull updates from a git remote
52git bug pull [<remote>]
53```
54
55In particular, the key commands to interact with Github are:
56```bash
57# Replicate your changes to the remote bug-tracker
58git bug bridge push [<bridge>]
59# Retrieve updates from the remote bug-tracker
60git bug bridge pull [<bridge>]
61```
62
63The command line tools are really meant for programmatic usage or to integrate `git-bug` into your editor of choice. For day to day usage, the recommended way is the interactive terminal UI. You can start it with `git bug termui`:
64
65![termui recording](../misc/termui_recording.gif)
66
67For a richer and more user friendly UI, `git-bug` proposes a web UI (read-only at the moment). You can start it with `git bug webui`:
68
69![web UI screenshot](../misc/webui2.png)