HBM4VT Repository Guide¶
Get a local copy¶
Clone the VIVA+ Documentation repository
git clone https://openvt.eu/fem/viva/vivaplus-docs.git
git submodule update --init --recursive
Adding new loadcase¶
Step 1: Fork the loadcase repo from EuroNCAP/HBM4VT Validation Catalog 1. Select VIVA/HBM4VT/LS-Dyna namespace 2. Edit project slug to specify the HBM size Step 2: Add the forked repository as submodule Inside the vivaplus-docs repository, cd to the location where the loadcase should be placed
cd docs/hbm4vt/path/to/loadcase/location
git submodule add https/link/to/VIVA/HBM4VT/repo
When the loadcases have been updated on the remote¶
If there are updates on the online loadcase repo that needs to updated locally or on the VIVA+ docs
# Update all submodules to latest commit on their tracked branch
git submodule update --remote --recursive
# Or, if you want to update and initialize any new submodules
git submodule update --init --remote --recursive
# After updating, you may want to commit the changes
git add .
git commit -m "Update submodules to latest commits"
Working on submodules¶
If you are working within the submodules within the docs repo, the head will be by default detached. First checkout the main branch before committing changes.
Updating all submodules at once¶
git submodule foreach 'git add -A && git commit -m "Your commit message here"'
git submodule foreach 'git pull --rebase origin main'
git submodule foreach git push origin HEAD:main
Advanced git reference¶
Handling commits on detached head¶
- If a commit has already been made on a detached head, as submodule tend to have a detached head, and you want to bring it to the main branch
- checkout the main:
git checkout main- merge using the commit hash, for examplegit merge 3d9c2a3- OR cherry pick, for example,git cherry-pick 3d9c2a3- to check the updates:git log --oneline
Using Worktrees to create folders based on branches¶
Worktrees are useful to make copies of folders of the same repository, but different branches, in different relative locations.
Worktree is used to create separate folders for simulation runs on the cluster.
- If the branch doesn't exist yet, create the branch git branch new-branch-name
- To create a new folder with the name "new-branch-name", git worktree add ../new-branch-name new-branch-name