Can you issue pull requests from the command line on GitHub?

后端 未结 9 2608
花落未央
花落未央 2020-11-28 17:48

It seems like you have to interact with github.com to initiate a pull request. Is this so?

9条回答
  •  广开言路
    2020-11-28 18:25

    A man search like...

    man git | grep pull | grep request
    

    gives

    git request-pull   []
    

    But, despite the name, it's not what you want. According to the docs:

    Generate a request asking your upstream project to pull changes into their tree. The request, printed to the standard output, begins with the branch description, summarizes the changes and indicates from where they can be pulled.

    @HolgerJust mentioned the github gem that does what you want:

    sudo gem install gh 
    gh pull-request [user] [branch]
    

    Others have mentioned the official hub package by github:

    sudo apt-get install hub
    

    or

    brew install hub 
    

    then

    hub pull-request [-focp] [-b ] [-h ]
    

提交回复
热议问题