Skip to content

Contributing to a GitHub Repository

pendingintent edited this page May 28, 2026 · 3 revisions

Working with a GitHub Repository

It is important that all developers contributing to a repository follow similar processes.

This page will use command-line Git. Another page will be created to demonstrate using extensions in VS Code to simplify the process.

Best Practices

  1. Install git in your environment. MacOS:
% brew install git
  1. Clone the repository:
% git clone https://github.com/cdisc-org/data-definition-engine.git

When ready to make changes, add features, start developing in the repository, it is important to create a new local branch in which to introduce changes/edits.

  1. Create a new local branch:
% git checkout -b <my-new-feature>

Use a descriptive name for your branch so others can identify the intention of the change.

  1. View status of changes in your local branch.

Once changes have been saved in your local branch, you can view the list of files that have been changed since the last commit or creation of the branch.

% git status

A list of changed (unstaged) files will be displayed.

% git status
On branch my-new-feature
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   src/soa_builder/web/app.py
        modified:   src/soa_builder/web/migrate_database.py
        modified:   src/soa_builder/web/templates/edit.html

no changes added to commit (use "git add" and/or "git commit -a")

5. Stage local files in preparation for commit to your local branch

```BASH
% git add <file>

If you are ready to stage all files with changes:

% git add --all

All changes are stored and ready for commit

  1. Commit the staged files to your local branch:
% git commit -m "<your descriptive message here>" <file>

Commit all staged files with the same message by omitting individual file names:

% git commit -m "<your descriptive message here>"

Now if you check the status:

% git status
On branch my-new-feature
Your branch is up to date with 'origin'.

nothing to commit, working tree clean

All of the changed files are now committed to your local branch.

These changes can now be Pushed to the GitHub repository.

  1. Synchronize changes with the GitHUb repository (this pushes your branch and changes to GitHub):
% git push origin {branch_name}

You may be prompted for a location to which to push the local branch.

Pull Requests

The repository should be configured to enforce creation of a Pull Request before changes can be Merged with another branch, i.e., main.

Another Wiki will be created to describe the process of creating a Pull Request in GitHub.

Clone this wiki locally