Skip to main content

Create a Branch and Pull Request

Git allows multiple features to be developed simultaneously across multiple branches. This guide covers creating a branch, staging and committing changes, pushing to GitHub, and opening a pull request.

This loosely follows GitHub Flow. See Branching Strategy for more context.

Procedure

  1. Check available branches and your current branch:

    bash — ~
    $ git branch
    * main
    
  2. Create and switch to a new branch:

    bash — ~
    $ git checkout -b feature/my-feature
    Switched to a new branch 'feature/my-feature'
    
    tip

    Per the Style Guide, avoid developing directly on main. Create a feature branch with a descriptive name.

  3. Make edits in VS Code or the Ignition Designer.

  4. Check what changed:

    git status
  5. Stage files for commit:

    # Single file
    git add file-name.ext

    # All changed files
    git add .
    note

    This adds files to the staging area but does not commit yet. You can run git add multiple times before committing.

    Which files should I add?

    Commit one feature or sub-feature at a time. If git status shows changes you didn't intentionally make (common with Ignition resource.json files), stash or skip them.

    Commit resource.json with its content file

    Ignition stores each resource as a pair: resource.json (metadata) and a content file (view.json, .py, etc.). Always commit them together - staging one without the other puts the resource in an inconsistent state that can break the Designer or prevent the project from loading.

    Also avoid committing session-props/props.json - it stores per-session UI state and changes constantly without representing meaningful work.

  6. Commit with a message:

    git commit -m "Brief description of change"
  7. Verify a clean working tree:

    bash — ~
    $ git status
    On branch feature/my-feature
    nothing to commit, working tree clean
    
  8. Push to the remote repository:

    git push origin HEAD
    • origin - the name of the remote (set during repo initialization)
    • HEAD - the current branch's latest commit
    Forgot the remote name?

    Run git remote -v to list all configured remotes.

    bash — ~
    $ git remote -v
    origin    https://github.com/your-org/your-repo.git (fetch)
    origin    https://github.com/your-org/your-repo.git (push)
    

Create a Pull Request

Pull Request vs. Merge Request

These are different terms for the same thing. GitHub uses "Pull Request"; GitLab uses "Merge Request." Git itself has no concept of either - they're features of the hosting platform.

  1. On GitHub, navigate to the main page of your repository.

  2. Select the Pull Requests tab.

    • If you recently pushed a branch, GitHub may show a banner prompting you to create a PR. Click it.

      GitHub banner prompting to create a pull request

    • Otherwise, select New pull request, choose your branch, and confirm the direction (feature branch → main).

  3. Fill in the PR details:

    • Title: Summarize the feature in a few words
    • Description: Add context, a bullet list of changes, or testing notes if helpful
  4. Select Create Pull Request.

Once created, the code needs to be reviewed before merging. On solo projects, you can review and merge yourself - but the habit of going through a PR is good practice even when working alone.