How do i create a pull request in github?



  • git man page: http://bit.ly/2nvGNWB

    Working in your local repository, you can branch off a change to a new branch and push that branch up to github instead of creating it off master.

    $ git checkout -b superduper_feature
    Switched to a new branch 'superduper_feature'
    $ ls
    README.md  trainers  tshirt  watch  water
    $ cd tshirt
    $ vi textfile  (make changes)
    $ git status
    On branch superduper_feature
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
    
    	textfile
    
    nothing added to commit but untracked files present (use "git add" to track)
    

    We have a new file called textfile, commit it.

    $ git add .
    $ git commit -m "New textfile that's going to change the world"
    [superduper_feature 7e480c3] New textfile that's going to change the world
     1 file changed, 1 insertion(+)
     create mode 100644 tshirt/textfile
    

    Push up the changes to github, using the new branch this time.

    $ git push origin superduper_feature
    Counting objects: 6, done.
    Delta compression using up to 4 threads.
    Compressing objects: 100% (4/4), done.
    Writing objects: 100% (4/4), 414 bytes | 0 bytes/s, done.
    Total 4 (delta 1), reused 0 (delta 0)
    remote: Resolving deltas: 100% (1/1), completed with 1 local objects.
    To [email protected]:testacct808/mygitrepo.git
     * [new branch]      superduper_feature -> superduper_feature
    

    If you refresh your repo in github you will see a Compare & Pull Request button, click that to create a pull request, because this is your own branches, you can Merge in your changes yourself, this is not normally the case, someone has to approve your changes before merging them, in effect they have to pull your code into theirs, hence the pull request term.

    After you merge you have an option to delete the branch.


Log in to reply
 

© Lightnetics 2024