Skip to content

Git

Submodules

Update the URL of an existing submodule:

shell
git submodule set-url <path> <new-url>
# Example: git submodule set-url hris ../hris

nhc-services — switch dev environment to main after merges

After feature branch MRs are merged, update the dev VM (nhc-dev) to track main:

shell
cd ~/nhc-apps/nhc-services

# Switch parent repo to main
git checkout main
git pull

# Switch all submodules (wp-cms, gatsby) to main and pull
git submodule foreach 'git checkout main && git pull'

# Verify submodule pointers are clean
git submodule status

Then restart the stack:

shell
docker compose down && docker compose up -d

nhc-services — update submodule pointers after changes in wp-cms or gatsby

When commits are merged in a submodule repo and you want the parent to track the new tip:

shell
cd ~/nhc-apps/nhc-services
make submodules-update

git add wp-cms gatsby
git commit -m "update submodule pointers"
git push

Moving to a New Git Host

Push all branches and tags to the new remote after updating the origin URL:

shell
git push --set-upstream origin --all
git push --set-upstream origin --tags