-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
89 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
title: Developer guide | ||
description: Want to help develop Harmony? | ||
date: 2024-02-29 | ||
image: "images/08- Questionnaire data analysis the smart way.svg" | ||
--- | ||
|
||
# Git and GitHub workflow | ||
|
||
The preferred workflow for contributing to Harmony’s repository is to fork the [main repository](https://github.com/harmonydata/harmony/) on GitHub, clone, and develop on a new branch. | ||
|
||
Please read our general guide about [contributing to Harmony](/contributing-to-harmony/). | ||
|
||
1. Fork the [main project repository](https://github.com/harmonydata/harmony) by clicking on the ‘Fork’ button near the top right of the page. This creates a copy of the code under your GitHub user account. For more details on how to fork a repository see [this guide](https://help.github.com/articles/fork-a-repo/). | ||
2. [Clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) your fork of the Harmony repo from your GitHub account to your local disk: | ||
|
||
``` | ||
git clone [email protected]:harmonydata/harmony.git | ||
cd harmony | ||
``` | ||
|
||
1. Configure and link the remote for your fork to the upstream repository: | ||
|
||
``` | ||
git remote -v | ||
git remote add upstream <https://github.com/harmonydata/harmony.git> | ||
``` | ||
|
||
1. Verify the new upstream repository you’ve specified for your fork: | ||
|
||
``` | ||
git remote -v | ||
\> origin <https://github.com/<username>/Harmony.git> (fetch) | ||
\> origin <https://github.com/<username>/Harmony.git> (push) | ||
\> upstream <https://github.com/harmonydata/harmony.git> (fetch) | ||
\> upstream <https://github.com/harmonydata/harmony.git> (push) | ||
``` | ||
|
||
1. [Sync](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork) the main branch of your fork with the upstream repository: | ||
|
||
``` | ||
git fetch upstream | ||
git checkout main | ||
git merge upstream/main | ||
``` | ||
|
||
1. Create a new feature branch from the main branch to hold your changes: | ||
|
||
``` | ||
git checkout main | ||
git checkout -b <feature-branch> | ||
``` | ||
|
||
Always use a feature branch. It’s good practice to never work on the main branch! Name the feature branch after your contribution. | ||
|
||
1. Develop your contribution on your feature branch. Add changed files using git add and then git commit files to record your changes in Git: | ||
|
||
``` | ||
git add <modified_files> | ||
git commit | ||
``` | ||
|
||
1. When finished, push the changes to your GitHub account with: | ||
|
||
``` | ||
git push --set-upstream origin my-feature-branch | ||
``` | ||
|
||
1. Follow [these instructions](https://help.github.com/articles/creating-a-pull-request-from-a-fork) to create a pull request from your fork. If your work is still work in progress, open a draft pull request. | ||
|
||
Note | ||
|
||
We recommend to open a pull request early, so that other contributors become aware of your work and can give you feedback early on. | ||
|
||
1. To add more changes, simply repeat steps 7 - 8. Pull requests are updated automatically if you push new changes to the same branch. | ||
|
||
Note | ||
|
||
If any of the above seems like magic to you, look up the [Git documentation](https://gitscm.com/documentation). If you get stuck, chat with us on [Discord](https://discord.gg/harmonydata), or contact us at [harmonydata.ac.uk](https://harmonydata.ac.uk/contact). |