README.md 1.83 KB
Newer Older
1
# github plugin
2

Gautam Kotian's avatar
Gautam Kotian committed
3
This plugin supports working with GitHub from the command line. It provides a few things:
4

5
6
* Sets up the `hub` wrapper and completions for the `git` command if you have [`hub`](https://github.com/github/hub) installed.
* Completion for the [`github` Ruby gem](https://github.com/defunkt/github-gem).
7
8
* Convenience functions for working with repos and URLs.

9
### Functions
10
11
12
13

* `empty_gh` - Creates a new empty repo (with a `README.md`) and pushes it to GitHub
* `new_gh` - Initializes an existing directory as a repo and pushes it to GitHub
* `exist_gh` - Takes an existing repo and pushes it to GitHub
Janosch Schwalm's avatar
Janosch Schwalm committed
14
* `git.io` - Shortens a URL using [git.io](https://git.io)
15
16


17
## Installation
18

Janosch Schwalm's avatar
Janosch Schwalm committed
19
[Hub](https://github.com/github/hub) needs to be installed if you want to use it. On OS X with Homebrew, this can be done with `brew install hub`. The `hub` completion definition needs to be added to your `$FPATH` before initializing OMZ.
20

Janosch Schwalm's avatar
Janosch Schwalm committed
21
The [`github` Ruby gem](https://github.com/defunkt/github-gem) needs to be installed if you want to use it.
22

23
### Configuration
24
25
26
27
28
29
30
31
32
33
34
35
36
37

These settings affect `github`'s behavior.

#### Environment variables

* `$GITHUB_USER`
* `$GITHUB_PASSWORD`

#### Git configuration options

* `github.user` - GitHub username for repo operations

See `man hub` for more details.

38
### Homebrew installation note
39

Gautam Kotian's avatar
Gautam Kotian committed
40
If you have installed `hub` using Homebrew, its completions may not be on your `$FPATH` if you are using the system `zsh`. Homebrew installs `zsh` completion definitions to `/usr/local/share/zsh/site-functions`, which will be on `$FPATH` for the Homebrew-installed `zsh`, but not for the system `zsh`. If you want it to work with the system `zsh`, add this to your `~/.zshrc` before it sources `oh-my-zsh.sh`.
41
42
43
44
45
46

```zsh
if (( ! ${fpath[(I)/usr/local/share/zsh/site-functions]} )); then
  FPATH=/usr/local/share/zsh/site-functions:$FPATH
fi
```