Skip to content

How to contribute

Alper Yilmaz edited this page Sep 30, 2016 · 7 revisions

How to contribute

If you wish to edit a file in another user's repository, Github will automatically fork the repository for you and thereafter you'll be doing edits in your own copy.

IMPORTANT : If you're doing edits from KMB304 or KMB204 then Chrome browser is the only one compatible with operations below. IExplorer or Firefox have issues, so please use Chrome browser instead

Let's visit the repository for our course material at https://github.com/alperyilmaz/BYM4591-book

If you want to edit chapter1.md file, click on the filename and a preview of the file contents will be shown. When the icon on the right top corner () is clicked you'll start editing the document.

Note: If the icon is grayed out it means you didn't confirm your github registration yet. Please check your email and then confirm your registration.

Now, we are in editor mode, you can edit the contents. As explained in blue notification box, you're not editing the original copy in author's repository. That repository is forked (aka cloned) for you and you're working on your own fork/clone.

If you would like to see if images, links are rendered correctly, you can click on "Preview Changes".

If you're done with editing the document and happy with the preview of it, scroll down to the bottom of the page. It's time to save the changes that has just been done. It would be extremely helpful to add short title and description regarding the nature of the change. Please describe the changes you had made in a concise manner. After adding description, you can click on "Propose file change" button.

The next page will compare the author's version and your version line by line. And on top of the page you'll see a button named "Create pull request". If you create a pull request:

  • The original author will be notified about your changes
  • After reviewing your edits, the author can accept or reject your changes
  • If your changes are accepted then author's copy will now have your changes and you have just contributed to someone else's repo. Congratulations 👏

During pull request, you'll be asked to provide title and description(1). Usually these information are carried over from "Propose file change" form if you have provided any. The default entry is Update filename but that is not explanatory so it would be great if you can describe what you have done (if you haven't done so in previous step). When ready press "Create pull request" button (2).

Congratulations, you have made edits and asked original author to include them in his/her repo. The original author will review and compare your changes.

How to sync your fork

Next time you would like to edit a file in instructor's repository, there's a synchronization problem you have to deal with. Since many students are contributing to the repository, you should be in sync with instructor's repository and start from most up-to-date version. There are two ways to achieve this, however both ways are cumbersome and not so straightforward:

  1. Delete your BYM4591-book fork and re-fork instructor's BYM4591-book repo and start editing that clone.

  2. You can sync your repo with latest version of instructor's repo as described below

Please go to your BYM4591-book fork and click on "Compare" link

Since instructor's repo is ahead of your fork, the page will indicate that author's repo is up to date with your version. In order to make reciprocal comparison we need to switch the base

Now, you can see the changes/commits that are present in instructor's repo but not in your fork. This might sound complicated but you can create a pull request to your own repo in this step. 😞

In next page you can write down description(1) as "syncing with original repo" and click on "Create pull request" button(2).

On top of Github page, you'll notice that "Pull reqests" tab will increase the counter. That means someone (which is you) is requesting changes in your repo. When you click on that tab you'll see summary and information about the changes. You need to click on "Merge pull request".

After that you need to confirm the merge.

Now, your fork is up-do-date with instructor's repo and you can start making more edits. You should be feeling much better because you're contributing now instead of complaining ;)

These instructions are put together by muhammerelek and bestebayar.

Clone this wiki locally