Code Monkey home page Code Monkey logo

mergo's Introduction

Mergo

Presentation

This tool comes from my need not to leave my terminal and that, although there is the hub client, you can not create a pull request for any git host you'd like from your terminal
So this binary creates pull request from terminal, it has been thought so that it doesn't have your specific host, you can add it easily
Its behavior is trying to be as close as possible to the git commands behavior and its default values try to follow the github pull request defaults

Install

go get -u gitlab.com/jfaucherre/mergo

Usage

mergo --help
Usage:
  mergo [OPTIONS]

Application Options:
  -v, --verbose        Add logs, you can have more logs by calling it more times
  -d, --head=          The head branch you want to merge into the base (default: the actual checked out branch)
  -b, --base=          The base branch you want to merge into (default: master)
  -m, --message=       The pull request message (default: If you have only one commit, it takes this commit's message)
  -f, --force          Force the pull request, doesn't ask you if you have unstaged changes or things like that
  -c, --clipboard      Copy the URLs of your merge requests to your clipboard
      --remote=        The remote to use (default: origin)
  -r, --remote-url=    The remote URLs to use. Note that this overwrite the "remote" option
  -e, --force-edition  Force the edition of the message event it already have a value
      --delete-creds=  Use this option when you want to delete the credentials of an host

Help Options:
  -h, --help           Show this help message
# placed in a repository on a branch you want to pull into master
mergo -m "My first pull request with mergo !"

Configuration

You can configure the default behavior of the binary through the git config by writing to the mergo section
For example suppose the default branch you want to merge into is not master but staging you can write

git config add mergo.base staging

After that all the pull requests you are going to create with mergo are going to be merged into staging and not master

All the configurable values are:

  • head
  • base
  • force
  • clipboard
  • remote
  • remote-urls
  • force-edition
  • verbose

Note that if you want to configure verbose for a certain level (from 1 to 5) you must give an array of boolean and not an int, because of how the argument parsing lib works:

# set log level to 3
git config add mergo.verbose true,true,true

Personal config

In order to use it as any other git command I made an alias of it in git like that

git config --global alias.pr '!mergo'

So that I can then run

git pr

Support

Mergo actually support:

  • github
  • gitlab

Do not hesitate to propose pull request to support more git hosts

mergo's People

Contributors

julesfaucherre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mzane42

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.