Github Guides

Contributing  to a projiect 

The Definition of Forking

    You may want to contribute to someone else's project.

    You would line to use someone's project as the starting point for your own.

    Creating a “fork” is producing a personal copy of someone else’s project. 

    Forks act as a sort of bridge between the original repository and your personal copy. 

    You can submitPull Requests to help make other people’s projects better by offering your changes up to the original project.

Fork the repository

    To fork the Spoon-Knife repository, click the Fork button in the header of the repository.

A repository's fork button

     Sit back and watch the forking magic. When it’s finished, you’ll be taken to your copy of the Spoon-Knife repository.

Clone your fork

    You’ve successfully forked the Spoon-Knife repository, but so far, it only exists on GitHub. To be able to work on the project, you will need to clone it to your computer.

    If you’re using GitHub for Desktop application, this process is a breeze. 

   On your fork of Spoon-Knife, navigate over to the bottom of the right hand side bar and click Clone in Desktop

   Once we click this, it’ll ask us if we want to launch our desktop application to clone the repository, and where we want to save it. 

   Pick a location on your computer that you feel comfortable with creating files and folders.

Clone in Desktop

Making and pushing changes

    Go ahead and make a few changes to the project using your favorite text editor.

    You could change the text in index.html to add your GitHub username.

    When you’re ready to submit your changes, type up a commit summary in GitHub for Desktop, and click Commit.

    Right now, you’ve essentially told Git, “Okay, I’ve taken a snapshot of my changes!” You can continue to make more changes, and take more commit snapshots. 

    When you’re ready to push your changes up to GitHub.com, click on theSync button, which is right above your list of changes.

Making a Pull Request

    At last, you’re ready to propose changes into the main project! 

   This is the final step in producing a fork of someone else’s project, and arguably the most important. 

   If you’ve made a change that you feel would benefit the community as a whole, you should definitely consider contributing back.

   To do so, head on over to the repository on GitHub.com where your project lives. 

   You’ll see a banner indicating that you’ve recently pushed a new branch, and that you can submit this branch “upstream,” to the original repository:

Recently pushed branch banner

    Clicking on Compare and Pull Request sends you to a discussion page, where you can enter a title and optional description. 

    It’s important to provide as much useful information and a rationale for why you’re making this Pull Request in the first place. 

    The project owner needs to be able to determine whether your change is as useful to everyone as you think it is.

    When you’re ready typing out your heartfelt argument, click onSend pull request. You’re done!

Send Pull Request button

    Pull Requests are an area for discussion. In this case, the Octocat is very busy, and probably won’t merge your changes.

    For other projects, don’t be offended if the project owner rejects your Pull Request, or asks for more information on why it’s been made. 

    It may even be that the project owner chooses not to merge your pull request, and that’s totally okay. 

   Your copy will exist in infamy on the Internet. And who knows–maybe someone you’ve never met will find your changes much more valuable than the original project. 

Huzzah!

    You’ve successfuly forked and contributed back to a repository. Go forth, and contribute some more!


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值