Return to Video

Pull Requests • GitHub & Git Foundations

  • 0:00 - 0:02
    Pull requests are a core part
  • 0:02 - 0:04
    of making a change
    to any GitHub repository.
  • 0:04 - 0:06
    Let's figure out
    how to use them effectively.
  • 0:07 - 0:09
    ♪ (music) ♪
  • 0:12 - 0:13
    Pull requests are a means
  • 0:13 - 0:16
    of submitting a change
    to another code base.
  • 0:16 - 0:18
    You can do this
    whether you're a core contributor,
  • 0:18 - 0:20
    or you're working
    at arm's length with a fork.
  • 0:20 - 0:22
    If you're not a core contributor,
    you can fork this project,
  • 0:22 - 0:24
    work on that change on your own
  • 0:24 - 0:26
    and send that change back as a proposal
  • 0:26 - 0:28
    on a pull request
    to the original author.
  • 0:28 - 0:33
    It means that making a correction
    becomes easier than making a complaint,
  • 0:33 - 0:37
    which is why GitHub has really facilitated
    the growth and development of Open Source.
  • 0:37 - 0:40
    Just make that edit,
    make it better,
  • 0:40 - 0:41
    everyone benefits.
  • 0:41 - 0:47
    This also applies to closed projects,
    corporate projects, private repos.
  • 0:50 - 0:52
    If you do have access
    to push to a repository,
  • 0:52 - 0:54
    you should still work on a branch
    and send that pull request
  • 0:54 - 0:56
    to get some review on your code.
  • 0:56 - 0:58
    This means you're going
    to create a branch,
  • 0:58 - 1:01
    start making some commits,
    and when you're ready to get it reviewed,
  • 1:01 - 1:04
    send that back to everyone else
    on your team in that pull request.
  • 1:04 - 1:07
    This means that a pull request
    is a conversation,
  • 1:07 - 1:10
    not just a one-shot submission
    of what's on a branch,
  • 1:10 - 1:13
    but rather, a little bit
    of dialogue and discussion,
  • 1:13 - 1:17
    some revision to the code,
    that all appears in chronological order,
  • 1:17 - 1:20
    and finally, an approval,
    or in the terrible case,
  • 1:20 - 1:25
    a thumbs down that says, "this does not
    seem like a wise change to the code base."
  • 1:25 - 1:29
    But in either of those two situations,
    the URL and the pull request lives on.
  • 1:32 - 1:33
    You don't have to stop talking
  • 1:33 - 1:35
    just because things
    were closed out and not accepted.
  • 1:35 - 1:38
    You can continue to find out
    why it wasn't accepted
  • 1:38 - 1:39
    and what changes
    you can make in the future
  • 1:39 - 1:41
    to ensure all your pull requests
    will be accepted.
  • 1:42 - 1:44
    This also serves as an educational tool
  • 1:44 - 1:46
    for people who join the team
    at a later time.
  • 1:46 - 1:49
    These pull requests are dialogues
    of what type of change
  • 1:49 - 1:51
    might be culturally acceptable here,
  • 1:51 - 1:54
    what are the expectations,
    requirements, formats
  • 1:54 - 1:55
    that people expect stuff in,
  • 1:55 - 1:59
    and you can save these URLs
    and point to them as educational tools
  • 1:59 - 2:00
    for these new individuals.
  • 2:01 - 2:03
    This means you don't have
    to forward on some email conversation
  • 2:03 - 2:05
    about how a feature came to be.
  • 2:05 - 2:08
    You can just point someone to a URL
    and they can look at it for all time.
  • 2:12 - 2:14
    We're also interested
    in the technical inputs,
  • 2:14 - 2:15
    not just the human ones.
  • 2:15 - 2:17
    A CI system, continuous integration,
  • 2:17 - 2:21
    like Travis, Hudson,
    Jenkins, Circle CI, Team City,
  • 2:21 - 2:24
    can all integrate
    with a GitHub pull request
  • 2:24 - 2:26
    and report the build status
    for this branch,
  • 2:26 - 2:29
    the fundamental unit of a pull request,
  • 2:29 - 2:31
    right in the line with that conversation.
  • 2:31 - 2:34
    So that means along with the conversation
    and the changes to code,
  • 2:34 - 2:37
    there's little build statuses
    that'll pop up to say,
  • 2:37 - 2:40
    "yes, all the tests have passed"
    or "no, we have some failing test".
  • 2:41 - 2:43
    It also affects the status
    of the Merge button
  • 2:43 - 2:45
    providing you a warning saying,
  • 2:45 - 2:47
    "wouldn't you like to have
    all the tests passing
  • 2:47 - 2:49
    and this branch be clean,
  • 2:49 - 2:52
    before you potentially press
    this Merge Pull Request button?"
  • 2:52 - 2:57
    So now that we have CI status integrated
    with the idea of human feedback,
  • 2:57 - 3:02
    we have holistic, human review
    plus technical set of tests,
  • 3:02 - 3:04
    but not only on the contents
    of the branch,
  • 3:04 - 3:09
    but on a predictive merge
    of both the branch and its destination,
  • 3:10 - 3:11
    so you get to see into the future
  • 3:11 - 3:13
    what this would be like if it was merged.
  • 3:13 - 3:15
    This doesn't mean
    that that merge is permanent.
  • 3:15 - 3:18
    It'll actually do that predictive merge,
    see how things go,
  • 3:18 - 3:20
    and then let you know
    if you did merge this in,
  • 3:20 - 3:21
    if you would be successful or not.
  • 3:24 - 3:28
    So if CI reports a good status,
    you have social acceptance
  • 3:28 - 3:30
    with a couple of thumbs up
    and ship its in the thread,
  • 3:30 - 3:33
    it's time to press
    the Merge Pull Request button.
  • 3:33 - 3:37
    Once that happens, you're also presented
    with the option to delete the branch,
  • 3:37 - 3:39
    which sounds kind of scary,
    but isn't a bad thing.
  • 3:40 - 3:42
    We don't have to really worry
    about closing out and deleting that branch
  • 3:42 - 3:45
    because all of the commits
    are in the destination branch.
  • 3:45 - 3:46
    They've been preserved,
  • 3:46 - 3:48
    so you can delete that branch
    to let people know
  • 3:48 - 3:50
    future development
    isn't happening over there.
  • 3:50 - 3:52
    The pull request still stays around,
  • 3:52 - 3:54
    in case you want
    the record of the discussion,
  • 3:54 - 3:57
    and your identity and the credit
    for the work that you've done
  • 3:57 - 4:01
    appears in the destination branch
    along with those merged in commits.
  • 4:03 - 4:05
    Thanks for watching this Git
    and GitHub Foundations episode
  • 4:05 - 4:08
    on the World renowned pull request.
  • 4:08 - 4:11
    Don't forget to click Subscribe
    on any of these channels on the side.
  • 4:11 - 4:15
    Or, ask us a question
    or leave a comment down below,
  • 4:15 - 4:17
    or check out any
    of these other educational videos
  • 4:17 - 4:19
    on Git and GitHub topics.
  • 4:20 - 4:22
    ♪ (outro music) ♪
Title:
Pull Requests • GitHub & Git Foundations
Description:

more » « less
Video Language:
English
Team:
GitHub
Project:
Git and GitHub Foundations
Duration:
04:27
There has been no activity on this language so far.

English subtitles

Revisions Compare revisions