Github how to use

Make a commit

On GitHub, saved changes are called commits. Commits are pretty glorious, because a bunch of them together read like the history of your project.

Each commit has an associated commit message, which is a description explaining why a particular change was made. Thanks to these messages, you and others can read through commits and understand what you’ve done and why.

You should still be on the code view for your readme-edits branch, now make some changes!

To commit changes

  1. Click the README file.
  2. Click Edit.
  3. In the editor, write some text, tell a bit about yourself.
  4. Write a commit message that describes your changes.

commitcommit

Click Commit changes. Now these changes have been made to the README file on your readme-edits branch and now this branch contains different content and commits than master (as it should!).

Open a Pull Request

Pull Requests are the heart of collaboration on GitHub. When you make a pull request, you’re proposing your changes and requesting that someone pull in your contribution - aka merge them into their branch. GitHub’s Pull Request feature allows you to compare the content on two branches. The changes, additions and subtractions, are shown in green and red and called diffs(differences).

As soon as you make a change, you can open a Pull Request. People use Pull Requests to start a discussion about commits (code review) even before the code is finished. This way you can get feedback as you go or help when you’re stuck.

By using GitHub’s @mention system in your Pull Request message, you can ask for feedback from specific people or teams, whether they’re down the hall or 10 time zones away.

You can even open, as we’re doing here, a Pull Request in your own repository and merge it yourself. It’s a great way to learn to process before working on larger projects.

Create a Pull Request for changes to the README

Click on the image for a larger version

Step Screenshot
Click the  Pull Request icon on the sidebar, then from the Pull Request page, click the green New pull request button. create pr
Select the branch you made,readme-edits, to compare withmaster (the original). branch
Look over your changes in the diffs on the Compare page, make sure they’re what you want to submit. diff
When you’re satisfied that these are the changes you want to submit, click the big green Create Pull Request button. create-pull
Give your pull request a title and since it relates directly to an open issue, include “fixes #” and the issue number in the title. Write a brief description of your changes. pr-form

When you’re done with your message, click Send Pull Request!


Tip: You can use emoji and drag and drop images and gifs onto comments and Pull Requests.

Merge your Pull Request

It’s time to bring your changes together – merge your readme-edits branch into the master branch.

  1. Click the green button to merge the changes into master.
  2. Click Confirm merge.
  3. Go ahead and delete the branch, since its changes have been incorporated, with the Delete branch button in the purple box.

mergedelete

If you revisit the issue you opened, it’s now closed! Because you included “fixes #1” in your Pull Request title, GitHub took care of closing that issue when the Pull Request was merged!

Celebrate!

You’ve learned to make a pull request on GitHub! :tada: :octocat: :zap:

For your humblebrag, here are the things you accomplished in this tutorial: created a repository, branch, issue, and pull request, then merged a pull request! Show off your new contribution squares!

If you want to learn more about the power of pull requests, we recommend reading the GitHub Flow Guide. You might also visit GitHub Explore and get involved in an Open Source project :octocat:




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章