Example repository for usage of the WatChMaL repository
See for reference: https://git-scm.com/book/en/v2/Git-Tools-Submodules
To clone the repo with submodules included:
$ git clone --recurse-submodules https://github.com/Whisky-Jack/WatChMaL_analysis.git
FOR NOW JUST TREAT THE SUBMODULE AS ITS OWN REPO, AND CD TO THE SUBMODULE DIRECTORY TO PUSH/PULL CHANGES
To fetch remote update the submodules you can:
- Enter the submodule directory and run fetch then merge. e.g.
$ cd WatChMaL
$ git fetch
$ git merge origin/master
- You can get Git to fetch updates for the submodule for you using
$ git submodule update --remote WatChMaL
To push local changes to a submodule you first need to add to stage the changes to the submodule in the main repo. You can then:
- Push local changes to the repo and check whether there are unpushed submodule changes using:
$ git push --recurse-submodules=check
This will warn you if any local submodule changes haven't been pushed, and give you instructions for how to push these changes. This should be done at a minimum to make sure you aren't pushing a version of the repo relying on unpushed local changes to the submodule.
- Push changes to the repo and try to automatically push changes to the submodule using:
$ git push --recurse-submodules=on-demand
- As before you can enter the submodule directory and use normal git commands:
$ cd WatChMaL
$ git push