Git Product home page Git Product logo

ghrepo's Introduction

ghRepo

A script to init a repository on Github from the command line.

Install

Install it to /usr/local/bin, or in another location. Just make sure it's added to PATH.

sudo install -v -m755 -o0 -g0 ghRepo /usr/local/bin

Preparations

To be able to use the script you'll need to set up an “access token”. You can go and create one at Github here:

''

Check the repo or puplic_repo.

Usage

$ ghRepo

Or copy the 2 functions and put in your ~/.bash_git (or ~/.bashrc etc).

Example output

$ cd /path/to/fooBar
$ git init && git add . && git commit -m "Initial commit"
$ ghRepo
»» Repo name (leave empty for 'fooBar'):
»» Add a short description: This is my new fooBar script.

:: Your Github username is missing in your config file(s)
»» Add this to global config (Y/n)?
»» Enter your Github username: YOUR_USER_NAME

:: Your Github token is missing in your config file(s)

    # To generate an access token, visit: <https://github.com/settings/tokens>
    # Token description: ghRepo

»» Add this to global config (Y/n)?
»» Enter your Github token: ACCESS_TOKEN

»» Creating Github repository: MyScript
origin	[email protected]:YOUR_USER_NAME/fooBar.git (fetch)
origin	[email protected]:YOUR_USER_NAME/fooBar.git (push)
:: Done

»» Pushing code to Github
:: Done

-----

    [!] You should branch off to 'devel', and work from there...

    $ git checkout -b devel

The script adds your username and token on first run, but you can set them manually of course:

git config --global github.username YOUR_USER_NAME
git config --global github.token ACCESS_TOKEN

When your Github username and token are already in .gitconfig:

$ ghRepo
»» Repo name (leave empty for 'fooBar'):
»» Add a short description: This is my new fooBar script

»» Creating Github repository: MyScript
origin	[email protected]:YOUR_USER_NAME/fooBar.git (fetch)
origin	[email protected]:YOUR_USER_NAME/fooBar.git (push)
:: Done

»» Pushing code to Github
:: Done

-----

    [!] You should branch off to 'devel', and work from there...

    $ git checkout -b devel

Misc

The script was made and inspired from these pages/posts...

Contributing

  1. Fork it (https://github.com/iEFdev/ghRepo/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

ghrepo's People

Contributors

iefdev avatar

Watchers

 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.