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: docs/contributing/documentation/index.md
+50Lines changed: 50 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -129,6 +129,56 @@ This practice differs according to the repository's files that you edit.
129
129
You can then edit the documentation of either Plone in the primary repository or any of the other projects in their folder inside the {file}`/submodules` folder.
130
130
131
131
132
+
### Git submodules
133
+
134
+
```{danger}
135
+
Every time you commit a git submodule, your deity kills a kitten.
:alt: Two furry brown brick characters with stubby arms and legs and razor sharp teeth chase an adorable kitten across a lush green lawn to its ultimate demise.
140
+
```
141
+
142
+
Please save teh kittehs!
143
+
Never commit a git submodule.
144
+
145
+
If you mistakenly ~~kill a kitten~~ commit a git submodule, then you can ~~time travel~~ revert the commit, depending on whether it was the most recent commit or earlier.
146
+
Use one of the following processes for what works best in your situation.
147
+
148
+
If it was in your most recent commit, use the following.
149
+
This command will also revert all other changes in the commit.
150
+
151
+
```shell
152
+
git reset --hard HEAD~1
153
+
```
154
+
155
+
If it was an earlier commit, use the following process.
156
+
Check out only the submodule folder to a specific commit or remote branch where the folder's changes are not committed.
Alternatively, use the log to copy the commit hash, and use that to check out that hash for your submodule folder.
164
+
165
+
```shell
166
+
git log
167
+
git checkout <commit-hash> -- <submodule-folder>
168
+
```
169
+
170
+
Finally, to force your cloned repository to use the same submodule as the upstream, pull the changes from upstream, then push to your cloned repository branch.
171
+
172
+
```shell
173
+
git pull upstream main
174
+
git push
175
+
```
176
+
177
+
```{seealso}
178
+
[How to undo a committed submodule command](https://stackoverflow.com/a/46500544/2214933).
179
+
```
180
+
181
+
132
182
(contributing-documentation-only-label)=
133
183
134
184
### Working with only the `plone/documentation` repository
0 commit comments