App::gh is an utility helps you operate commands through GitHub's API, currently App::gh is migrating to GitHub API v3.
App::gh is written in Perl, so you might need a cpanminus to install CPAN modules, to install cpanminus:
$ curl -L http://cpanmin.us | perl - --sudo App::cpanminusNow you have cpanm, you can install App::gh
$ sudo cpanm https://github.com/c9s/App-gh/zipball/developTo use App::gh, you need to configure your password or OAuth
token in your .gitconfig file, just drop the lines below
to setup your password:
[github]
user = c9s
password = your passwordTo use OAuth token, you need to set your OAuth access token:
[github]
user = c9s
access_token = SHA1601f1889667efaebb33b8c12572835da3f027f78To clone a repository, use below command form:
$ gh clone [user]/[repo]
$ gh clone [user] [repo]When cloning repository from others, the default URI is
HTTP, which is read-only.
When cloning repository from yourself, the default URI is
SSH, which is read & write.
To specify URI type, you can simply pass options like
--http for HTTP, --https for HTTPS, --ssh for SSH,
--ro for read-only URI. e.g.:
$ gh clone miyagawa Plack
$ gh clone user repo --http
$ gh clone user repo --https
$ gh clone user repo --ssh
$ gh clone clkao Web-Hippie --roClone from SSH URI:
$ gh clone miyagawa/Plack --sshTo fetch related remote of forks, you can specify
--forks option. this command allows you to download
commits from others' fork.
$ gh clone c9s App-gh --forksTo clone repository and set the default remote name instead
of origin, you can specify --origin option:
$ gh clone c9s App-gh --origin githubBy using the all command, you can clone all repositories
from an user.
Below is the basic form:
$ gh all [user] [type]The [type] can be member, all, owner. if you specify
all then all repositories including fork projects will be
cloned. if you specify owner, then only the owner's
projects will be cloned.
For example, to clone all repositories of miyagawa:
$ gh all miyagawaTo clone all repositories that owned by facebook:
$ gh all facebook ownerBy specifing --into option, you can clone these
repositories into a specific directory, for example:
$ gh all facebook owner --into path/to/facebook
$ gh all perl6 --into perl6-stuffTo prompt before cloning each repository:
$ gh all perl6 --promptTo also fetch tags, you can specify --tags option:
$ gh all facebook --tagsYou can also specify a prefix to each repo:
$ gh all facebook --prefix=facebook-prefix-To clone these repositories as bared:
$ gh all facebook --bareTo recursively clone submodules:
$ gh all perl6 --recursiveBy using the import command, you can import your git
repository to your GitHub account.
You can simply type below line the upload your project:
$ gh importTo specify remote name for GitHub, you can use --remote
option.
$ gh import --remote githubTo search repositories, simply use search command:
$ gh search keywordSometimes you need to update remote refs, branches, tags,
you might run git remote update --prune, and run pull with
--rebase option to rebase changes on your local branch.
With App::gh, you can do simpler with the update command.
$ gh updateThe command above actually runs:
git remote update --prune
git remote | while read remote; do
git pull --rebase $remote $(git rev-parse --abbrev-ref HEAD)
doneTo install this module, run the following commands:
# Makefile.PL needs this
cpan Module::Install::AuthorTests
perl Makefile.PL
make
make test
make install
$ mkdir ~/.zsh/functions
$ cp completion/zsh/_gh ~/.zsh/functions
add ~/.zsh/functions to your fpath
$ vim ~/.zshrc
fpath=(~/.zsh/functions/ $fpath)
please keep the dependency simple and less.
Alexandr Ciornii alexchorny@gmail.com
Breno G. de Oliveira garu@cpan.org
Chris Weyl cweyl@alumni.drew.edu
Fuji, Goro gfuji@cpan.org
Ryan C. Thompson rct@thompsonclan.org
Tokuhiro Matsuno tokuhirom@gmail.com
Yo-An Lin cornelius.howl@gmail.com
Zak B. Elep zakame@zakame.net
c9s cornelius.howl@gmail.com
chocolateboy chocolate@cpan.org
mattn mattn.jp@gmail.com
tokuhirom tokuhirom@gmail.com
tyru tyru.exe@gmail.com
xaicron xaicron@gmail.com
yj liyuray@gmail.com
After installing, you can find documentation for this module with the perldoc command.
perldoc App::gh
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=App-gh
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/App-gh
CPAN Ratings
http://cpanratings.perl.org/d/App-gh
Search CPAN
http://search.cpan.org/dist/App-gh/
Copyright (C) 2010 Cornelius
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.