Using git § I changed a submodule by accident: be explicit

Rewriting git history is something that is often difficult for new contributors,
and we're already explaining the `<foo>` placeholder syntax,
so I think it makes sense to be explicit about what exactly the paths mean.
This commit is contained in:
lolbinarycat 2025-06-10 12:48:05 -05:00 committed by GitHub
parent 06ddcae4be
commit aa0516b863
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -142,7 +142,8 @@ The most common cause is that you rebased after a change and ran `git add .` wit
`x` to update the submodules. Alternatively, you might have run `cargo fmt` instead of `x fmt` `x` to update the submodules. Alternatively, you might have run `cargo fmt` instead of `x fmt`
and modified files in a submodule, then committed the changes. and modified files in a submodule, then committed the changes.
To fix it, do the following things: To fix it, do the following things (if you changed a submodule other than cargo,
replace `src/tools/cargo` with the path to that submodule):
1. See which commit has the accidental changes: `git log --stat -n1 src/tools/cargo` 1. See which commit has the accidental changes: `git log --stat -n1 src/tools/cargo`
2. Revert the changes to that commit: `git checkout <my-commit>~ src/tools/cargo`. Type `~` 2. Revert the changes to that commit: `git checkout <my-commit>~ src/tools/cargo`. Type `~`