Git Product home page Git Product logo

app-gh's Introduction

App::gh

App::gh is an utility helps you operate commands through GitHub's API, currently App::gh is migrating to GitHub API v3.

Installation

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::cpanminus

Now you have cpanm, you can install App::gh

    $ sudo cpanm https://github.com/c9s/App-gh/zipball/develop

Setup

To 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 password

To use OAuth token, you need to set your OAuth access token:

    [github]
        user = c9s
        access_token = SHA1601f1889667efaebb33b8c12572835da3f027f78

Commands

clone

To 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 --ro

Clone from SSH URI:

    $ gh clone miyagawa/Plack --ssh

To 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 --forks

To clone repository and set the default remote name instead of origin, you can specify --origin option:

    $ gh clone c9s App-gh --origin github

all

By 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 miyagawa

To clone all repositories that owned by facebook:

    $ gh all facebook owner

By 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-stuff

To prompt before cloning each repository:

    $ gh all perl6 --prompt

To also fetch tags, you can specify --tags option:

    $ gh all facebook --tags

You can also specify a prefix to each repo:

    $ gh all facebook --prefix=facebook-prefix-

To clone these repositories as bared:

    $ gh all facebook --bare

To recursively clone submodules:

    $ gh all perl6 --recursive

import

By 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 import

To specify remote name for GitHub, you can use --remote option.

    $ gh import --remote github

search

To search repositories, simply use search command:

    $ gh search keyword

update

Sometimes 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 update

The command above actually runs:

    git remote update --prune
    git remote | while read remote; do
        git pull --rebase $remote $(git rev-parse --abbrev-ref HEAD)
    done

INSTALLATION

To install this module, run the following commands:

# Makefile.PL needs this
cpan Module::Install::AuthorTests

perl Makefile.PL
make
make test
make install

COMPLETION

zsh

$ mkdir ~/.zsh/functions
$ cp completion/zsh/_gh  ~/.zsh/functions

add ~/.zsh/functions to your fpath

$ vim ~/.zshrc

fpath=(~/.zsh/functions/ $fpath)

DEVELOPMENT

please keep the dependency simple and less.

CONTRIBUTORS

Alexandr Ciornii [email protected]
Breno G. de Oliveira [email protected]
Chris Weyl [email protected]
Fuji, Goro [email protected]
Ryan C. Thompson [email protected]
Tokuhiro Matsuno [email protected]
Yo-An Lin [email protected]
Zak B. Elep [email protected]
c9s [email protected]
chocolateboy [email protected]
mattn [email protected]
tokuhirom [email protected]
tyru [email protected]
xaicron [email protected]
yj [email protected]

SUPPORT AND DOCUMENTATION

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/

LICENSE AND COPYRIGHT

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.

app-gh's People

Contributors

c9s avatar chocolateboy avatar chorny avatar darwinawardwinner avatar garu avatar gfx avatar liyuray avatar mattn avatar rsrchboy avatar tokuhirom avatar tyru avatar xaicron avatar yanick avatar zakame avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.