git/list[1] front-page[2] threads[3] people[4] search[5] about
 

bug: checkout --recurse-submodules discard uncommited changes in submodule

From
KBKevin Bernard <kevin.bernard@fiveco.ch>
Date
Jan 14, 2021, 08:35 UTC
Message-ID
<570e77a07f0b4d4ea09307e5fa819d6f@fiveco.ch>

Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue) Make a git repository with a submodule in it. Make two different commits in the main repository with two different versions of the submodule, one of them is the head of the branch. Checkout the head of the branch in the main repository, and make a submodule update. Make a modification, do not commit it, in a submodule file that will not result in a "error: Your local changes to the following files would be overwritten by checkout" when the other version of the library will be checked out. Go back to the main repository and make a checkout of the other commit with the switch --recurse-submodules.

What did you expect to happen? (Expected behavior) The checkout with the switch --recurse-submodules should fail when there are uncommitted changes in the submodule.

What happened instead? (Actual behavior) Uncommitted changes in the submodule are discarded without any notifications.

What's different between what you expected and what actually happened? Loss of the uncommitted changes in the submodule.

Anything else you want to add: I stay at your disposal if you need more information.

Please review the rest of the bug report below. You can delete any lines you don't wish to share.

[System Info] git version: git version 2.30.0.windows.1 cpu: x86_64 built from commit: 18da6dbba950f8cc7b7d07057f7c30bf7cf207b6 sizeof-long: 4 sizeof-size_t: 8 shell-path: /bin/sh uname: Windows 10.0 19041 compiler info: gnuc: 10.2 libc info: no libc information available $SHELL (typically, interactive shell): C:\Program Files\Git\usr\bin\bash.exe

[Enabled Hooks]
Sincerely yours,
Kevin Bernard
Next: Philippe Blain
Message 1 of 3 in “bug: checkout --recurse-submodules discard uncommited changes in submodule”
  1. Kevin BernardJan 14, 2021
  2. Philippe BlainJan 14, 2021
  3. Kevin BernardJan 14, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.