Skip to content

Git Notes

John Reppy edited this page Jun 3, 2026 · 9 revisions

This document collects together some common git patterns that we use to manage the SML/NJ development branch.

Checkout

git clone --recurse-submodules git@github.com:smlnj/smlnj.git

Update the LLVM submodule to the latest version

Switch to the submodule directory and then update to the latest version. Then we have to commit and push the submodule. Note that the name of the LLVM submodule changes over time as we update the version of LLVM that we are using.

# switch to the submodule directory
cd runtime/llvm21

# checkout the main branch
git checkout main

# pull the latest version
git pull

# switch back to the parent repo
cd ../..

# update the parent repo
git commit -a -m "update version of code generator submodule"
git push

To remove the old version of the module

git rm runtime/old
git commit -m "remove old submodule"
git push

Note that the submodule will persist in the .git subdirectory.

Update a copy of the repository

Include the --recurse-submodules option when pulling the code to ensure that we get any changes to the submodule.

git pull --recurse-submodules

Adding a new version of LLVM as a submodule

git submodule add https://github.com/smlnj/smlnj-llvm-21.1.git llvm21

Tagging the repository

To add a tag $TAG

git tag -a $TAG -m "some comment"
git push origin tag $TAG

To remove a tag

git push --delete origin $TAG
git tag -d $TAG

Clone this wiki locally