How to do a GitHub pull request

前端 未结 8 2073
一个人的身影
一个人的身影 2020-11-22 03:12

How do I create and/or send a pull request to another repository hosted on GitHub?

8条回答
  •  半阙折子戏
    2020-11-22 03:58

    To learn how to make a pull request I just followed two separate help pages on Github (linked below as bullet points). The following command line commands are for Part 1. Part 2, the actual pull request, is done entirely on Github's website.

    $ git clone https://github.com/tim-peterson/dwolla-php.git
    $ cd dwolla-php
    $ git remote add upstream https://github.com/Dwolla/dwolla-php.git
    $ git fetch upstream
    // make your changes to this newly cloned, local repo 
    $ git add .
    $ git commit -m '1st commit to dwolla'
    $ git push origin master
    
    • Part 1: fork someone's repo: https://help.github.com/articles/fork-a-repo

      1. click the 'fork' button on the repo you want to contribute to, in this case: Dwolla's PHP repo (Dwolla/dwolla-php)
      2. get the URL for your newly created fork, in this case: https://github.com/tim-peterson/dwolla-php.git (tim-peterson/dwolla-php)
      3. type the git clone->cd dwolla-php->git remote->git fetch sequence above to clone your fork somewhere in your computer (i.e., "copy/paste" it to, in this case: third_party TimPeterson$) and sync it with the master repo (Dwolla/dwolla-php)
      4. make your changes to your local repo
      5. type the git add->git commit->git push sequence above to push your changes to the remote repo, i.e., your fork on Github (tim-peterson/dwolla-php)
    • Part 2: make pull-request: https://help.github.com/articles/using-pull-requests

      1. go to your fork's webpage on Github (https://github.com/tim-peterson/dwolla-php)
      2. click 'pull-request' button
      3. give pull-request a name, fill in details of what changes you made, click submit button.
      4. you're done!!

提交回复
热议问题