Skip to main content

Fork and contribute to the API

· 3 min read
Marco Pellegrino
Nerd Structural Engineer

Fork and clone

GitHub Desktop provides a user-friendly way to collaborate on open-source projects without needing to use complex command-line commands. Here’s a step-by-step guide to contribute to an open-source project using GitHub Desktop, along with visual references from the images provided.

  1. Fork the Repository

    Navigate to femdesign-api repository and click on Fork.

    grasshopper

    Forking creates a copy of the repository in your GitHub account where you can make changes. From the second image:

    grasshopper

    Select your account and give the forked repository a name (you can use the default). Click Create Fork.

  2. Clone Your Fork Using GitHub Desktop

    grasshopper

    Once your fork is ready ,go to your forked repository on GitHub, click the green Code button, and choose Open with GitHub Desktop.
    If GitHub Desktop isn’t installed, you’ll be prompted to download it.
    Select a folder on your local computer where the repository will be cloned.

    Your repository is now ready for editing on your local machine.

  3. Create a New Branch for Your Changes

    To avoid changing the main branch directly, create a new branch.

    In GitHub Desktop, go to the top bar and click Current Branch. Select New Branch, give it a descriptive name (e.g., update-material-docs), and click Create Branch.

    grasshopper

    Now you’re ready to make changes.

  4. Make Changes to the Project

    Open the .sln file within the cloned repository folder in your preferred code editor (Visual studio is the recommended for this project). Edit the files or add new features.

  5. Commit Your Changes Locally

    grasshopper Return to GitHub Desktop, where you’ll see a summary of your changes under the Changes tab. Write a short, descriptive message about what you’ve done in the Summary field (e.g., “Updated Material.cs to fix bug”). Click Commit and then push.

    This saves your changes locally in your branch and uploads your changes from your local branch to the corresponding branch on your forked repository in GitHub.

  6. Create a Pull Request

    grasshopper

    On GitHub, navigate to your forked repository and click the contribute -> open pull request.

    Fill the information in the pull request template, including a title and description of your changes.

Reference the Development branch

If our API is missing certain functionality needed for your project, you may require additional support or development from our team. In such cases, using the development branch is highly beneficial, as it contains the most up-to-date version of the API. This allows you to access new methods and implementations before their official release. To do so, you can switch to the Dev branch (typically identifiable by a _Dev suffix) and reference the API from there.

Instead of referencing the API through NuGet in your project, you can link it directly via the .csproj file. This approach ensures that when you update or fetch the API repository, your project will automatically incorporate the latest version.

grasshopper grasshopper

I hope this guide was helpful. If you have any questions, feel free to send a message to the community page.