Skip to content

Configuring your Github account

Mike Meehan edited this page Nov 5, 2021 · 4 revisions

We follow the convention of forking the repository, modifying your source code, then submitting a pull request where other members of the lab can inspect your new content. Note that there is probably an infinite number of ways of doing the same thing, we just describe one way.

Note, if you already have a fork, be sure to follow instructions under "Conflicts" first. You want to be working from up to date code before committing new code so conflicts do not arise.

Forking repository to your account

At the website source code, click "Fork" in the top right to create a repository in your personal Github account. Now go to your personal Github page and click "Clone or download." Copy that link. Open a terminal up (assuming Unix based system) and go a folder where you would like to place the source code. Execute git clone [URL]. You should now see the folder containing the website source code. One last critical step is to follow these directions to configure a remote to point at the website hosted by tesla-cu. This will allow you to get stay up-to-update with the upstream repository.

Merging new information

Now that you have added all the content you wanted, it's time to get onto the website!

Add and commit

First, execute

  • git add file
  • git commit -m "message"

Please, do not use add * or add .. Be cognizant of what you are adding. There can be strange files that appear and conflict with building the website. We also recommend breaking down the commits to be specific (i.e., "added buoyant jet publication" not "added stuff"). If you are adding a lot, add files in groups, and commit each group with your specific message.

Conflicts

Next, we need to check that you don't conflict with your fork or the tesla-cu repo. You can/should do this before adding new code (as stated above) so conflicts do not arise. Execute

  • git fetch
  • git pull
  • git fetch upstream
  • git pull upstream

If you don't have any conflicts, you are good to go! If you do, you will need to resolve them.

Push and pull

Finally, execute git push from your website directory. This will update the code on your personal repository. Go online to your Github profile. Under your fork, click the "Pull Request" tab then "New Pull Request." Review all the updates, provide a clear message, and submit the PR. Another contributor will take a look at your code to make sure it is good to go before merging into the master branch.

Review process

If the reviewer(s) of the code want(s) a modification (i.e., missing data, typos, etc.), simply repeat the above processes. Once you finally push an updated version of the code to your personal fork, this will update the PR, and the reviewer(s) can see the modifications you have made. This can be repeated until the reviewer(s) is satisfied.