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: src/git.md
+31
Original file line number
Diff line number
Diff line change
@@ -566,6 +566,37 @@ to know everything about submodules to contribute to Rust. Just know that they
566
566
exist and that they correspond to some sort of embedded subrepository dependency
567
567
that Git can nicely and fairly conveniently handle for us.
568
568
569
+
### Hard-resetting submodules
570
+
571
+
Sometimes you might run into (when you run `git status`)
572
+
573
+
```
574
+
Changes not staged for commit:
575
+
(use "git add <file>..." to update what will be committed)
576
+
(use "git restore <file>..." to discard changes in working directory)
577
+
(commit or discard the untracked or modified content in submodules)
578
+
modified: src/llvm-project (new commits, modified content)
579
+
```
580
+
581
+
and when you try to run `git submodule update` it breaks horribly with errors like
582
+
583
+
```
584
+
error: RPC failed; curl 92 HTTP/2 stream 7 was not closed cleanly: CANCEL (err 8)
585
+
error: 2782 bytes of body are still expected
586
+
fetch-pack: unexpected disconnect while reading sideband packet
587
+
fatal: early EOF
588
+
fatal: fetch-pack: invalid index-pack output
589
+
fatal: Fetched in submodule path 'src/llvm-project', but it did not contain 5a5152f653959d14d68613a3a8a033fb65eec021. Direct fetching of that commit failed.
590
+
```
591
+
592
+
If you see `(new commits, modified content)` you can run
0 commit comments