Skip to content

How to Change Submodule Branch Commit

Wesley B edited this page May 11, 2022 · 2 revisions

Steps

These instructions assume you are in TACC/Core-CMS and have already run git submodule init and gist submodule update.

  1. Change the pinned commit of submodule.
    (Downloads code from different commit of cms-site-resources repo to taccsite_custom/.)

    # Navigate into submodule (from root of this repo)
    cd taccsite_custom
    # Checkout different commit of submodule repo
    git checkout main_or_other_branch_or_commit
    # Update commit of submodule repo (as necessary)
    git pull # (or git fetch […], etc.)
  2. Save the pinned commit of submodule.
    (Updates the pinned commit of cms-site-resources repo at taccsite_custom/.)

    # Navigate back to this repo (from root of submodule repo)
    cd ../
    # Commit this repo's pointer to a different commit of submodule repo
    git add taccsite_custom
    git commit -m "[…] Update submodule to get […]"
  3. Push the change to a relevant branch.
    (So that the change can be reviewed with relevant Core code changes, if any.)