Skip to content

GitHub Collaboration Guide

Erik edited this page Jan 9, 2025 · 1 revision

How to collaborate

This tutorial will be requiring an already cloned copy of this repository and the basic git setup. It will also be requiring you to be checked out into your Dev branch e.g. dev-erik in my case.

Syncing your branch

The first step for pushing some commits is to get your Dev branch up to date. For this, navigate to GitHub and switch the view to your branch. image

Next up, check if your branch is up to date. If this message notifies you that your branch is n commits behind master, your branch is not up to date. This means we need to sync it. If it does not show this message, or it only says n commits ahead of master you are good to go and can proceed to the next step, Updating your local repository.

image image

Creating a Sync pull request (only if not up to date)

Creating a sync pull request can once again be done trough GitHub. For this, click the message saying you are behind master. After this, you will end up in the following menu.

image

Make sure the base (left) is set to your branch and the compare (right) is set to master. After that, click the Create pull request button. Now, you are in the main pull request menu.

Firstly, optionally set the title to "Sync" and optionally clear the content text box.

image

After all checks have been completed, you can proceed to merge your pull request by clicking the Merge and then Confirm Merge buttons.

image image

Updating your local repository

This can be done trough various means. The most common and versatile way you can do this is by running git push in the command line. Since most of our collaborators are working in WebStorm, i will cover this way too.

In the git tool windows, click Update Project

image

Then, click OK.

image

Congrats, you have now updated your local repository. It is required that you do this every time you want to push some commits.

Pushing your commits

This is the most basic step of the operation. I will not go into detail here since this is very easy to learn via google.

Syncing your commits from your Dev branch to the master branch

This step will be done again, via a pull request.

For this, navigate to the GitHub page and switch the view to your repository as mentioned before. Your message should now be looking like this.

image

If it still says, n commits behind master, you need to sync your branch and update your local repository. This rarely happens though since if you follow the tutorial you will have done this ahead of time.

Make sure the base (left) is set to master and the compare (right) is set to your dev branch. Then, proceed with creating the pull request.

image

Next up, find a good title, a fitting description and request a review. Finally, click Create Pull Request.

image

You DO NOT need to merge this request yourself, since it requires a review and you already requested one. The following image shows the state before review.

image

After Merging your PR should look like this. NEVER DELETE YOUR BRANCH

image

After this, you have successfully updated the repo with your new content.