You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/developer-docs/git-howto.md
+24-12Lines changed: 24 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,29 +117,41 @@ How to merge fork tpurschke/master into CactuseSecurity/master
117
117
118
118
git push -u origin auth_frontend
119
119
120
-
## Update submodules
120
+
## Submodules
121
+
IMPORTANT: Always commit to the submodule first, then commit to the FWO repo (superproject). This avoids the problem that the FWO repo does not point to the newest commit of the submodule (it cant - since it does not exist yet). An addtional commit to the FWO-repo will be necessary to fix this.
121
122
122
-
### Initial update
123
-
Update submodules to the commits recorded in the superproject (safe, reproducible). Initializes them if necessary.
124
-
Execute this command after the initial clone of the fwo repo in the fwo repo root directory:
123
+
### Automatic submodule sync via repo hooks
124
+
Enable the repo-managed hooks once (per clone) to keep submodules up to date automatically:
125
+
```shell
126
+
git config core.hooksPath .githooks
127
+
```
128
+
The hooks run after `git pull`, `git checkout`, and `git rebase` and execute:
125
129
```shell
126
130
git submodule update --init --recursive
131
+
git submodule update --remote --merge --recursive
127
132
```
133
+
Notes:
134
+
- The hook is quiet if you do not have access to a submodule repository (no error output).
135
+
- The hook checks out the configured submodule branch from `.gitmodules` before updating, to avoid detached HEAD.
136
+
- This intentionally moves submodules to the newest commit on their configured branch, even if the superproject has not updated the pointer yet. Expect the submodule to appear "modified" in `git status`.
128
137
129
-
## Update agents repo --> might be moved to githook later
138
+
### Manual submodule operations
139
+
If you like to manually execute the submodule setup, see the sections below. Otherwise, please refer to the section above.
130
140
131
-
This updates the agents repo manually. Update submodules to the latest commit on their configured remote tracking branch. Execute this command to get the newest version of all submodules from their respective repositories.
141
+
#### Initial update
142
+
Update submodules to the commits recorded in the superproject (safe, reproducible). Initializes them if necessary.
143
+
Execute this command after the initial clone of the fwo repo in the fwo repo root directory:
132
144
```shell
133
-
git submodule update --remote --recursive
145
+
git submodule update --init --recursive
134
146
```
135
-
NB: This overwrites the agents repo data again with the one from the firewall-orchestrator repo!
136
147
137
-
##Configure to always pull recursively
138
-
Permanent configuration change: make `git pull` recurse into submodules
148
+
#### Update agents repo manually
149
+
This updates the agents repo manually. Update submodules to the latest commit on their configured remote tracking branch. Execute this command to get the newest version of all submodules from their respective repositories.
139
150
```shell
140
-
git config submodule.recurse true
151
+
git submodule update --remote --merge --recursive
141
152
```
142
-
## Check correct file state
153
+
154
+
### Check correct file state
143
155
```shell
144
156
tim@acantha24:~/dev/tim/fwo$ git ls-tree HEAD agents
0 commit comments