Coder Social home page Coder Social logo

github-pull-request-basics-v-000's Introduction

#Github Pull Request Basics

##Objectives:

  1. Understand what a pull request is
  2. Identify how to create a pull request from one fork to another
  3. Identify how to add commits to an existing pull request

##Overview: The concept of a pull request is unique to Github, meaning it does not exist outside of Github. Conceptually, it is a request for the owner of a receiving party (learn-co-students in the case of labs) to pull from you, because it would be rude to push your code onto someone else.

Let's go over a familiar example. Let's say you fork a repo from https://github.com/learn-co-students/awesome-lab. You now have a copy of that repo on your Github account here https://github.com/your-user-name/awesome-lab.

So you clone down that fork to your computer, make some changes and now you want to make a pull request back up to https://github.com/learn-co-students/awesome-lab.

Basically you are saying, "I have made these changes to the original repo, will you accept them?" You are requesting that learn-co-students take your changes and combine them into the original repo that you've forked. It's a way for you to work on someone else's code without breaking their codebase.

Pull requests are what power the open source community. Through this process, anyone can fork a repo, make changes and submit a pull request. Now instead of just the owner working on their codebase, anyone can work on it. Here is a great example of a pull request on the Ruby codebase.

###Pull Request From One Fork To Another

Let's say you fork repository https://github.com/learn-co-students/awesome-lab as https://github.com/your-user-name/awesome-lab. Then you make some changes to your newly forked repo. Another student forks the repository https://github.com/learn-co-students/awesome-lab as https://github.com/their-user-name/awesome-lab.

Now you make some changes and you want to send a pull request to their fork https://github.com/their-user-name/awesome-lab. How do you do this?

###Step 1 Navigate to your forks page, https://github.com/your-user-name/awesome-lab and click on pull requests in the top right corner.

###Step 2 Click on the green New Pull Request button.

###Step 3 Here you can choose the base fork, which will be their-user-name/awesome-lab. Then choose the head fork, which will be your-user-name/awesome-lab Now click Create pull request.

###Add Commits To An Existing Pull Request Let's say you make a pull request from https://github.com/your-user-name/awesome-lab to https://github.com/learn-co-students/awesome-lab. Then you notice you made a typo in your code. All you have to do is fix the typo, commit it and push up the changes to your branch. As long as the pull request already exists, the commits will be added automatically.

View Github Pull Request Basics on Learn.co and start learning to code for free.

github-pull-request-basics-v-000's People

Watchers

 avatar  avatar

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.