There is a repo R with a submodule S.
S has some experimental changes and is on a detached HEAD. Among the changes, there is a new file, CMakeUserPresets.json, a new directory new_dir with a copy of CMakeUserPresets.json, and some other files have been modified.
Neither CMakeUserPresets.json nor new_dir are staged.
Switch to the main repo R, click "Local Changes". Among the changes, there is the submodule S marked as "M". Right-click S and in the context menu click "Discard submodule changes".
The last action deletes CMakeUserPresets.json, but does not delete new_dir with its files.
I would like CMakeUserPresets.json to remain intact (the same way new_dir is) when clicking "Discard submodule changes" in the main repo. Imagine that this is a new configuration file that has just been added to the working copy, but not staged yet. When discarding submodule changes and then switching to other branch, I'd like to use the same config CMakeUserPresets.json for other branches. CMakeUserPresets.json is a good candidate for adding to .gitignore in S, but while that has not been done, it would be nice if Fork did not delete unstaged files.
Fork v1.92.0.0.
There is a repo
R
with a submoduleS
.S
has some experimental changes and is on a detached HEAD. Among the changes, there is a new file,CMakeUserPresets.json
, a new directorynew_dir
with a copy ofCMakeUserPresets.json
, and some other files have been modified. NeitherCMakeUserPresets.json
nornew_dir
are staged. Switch to the main repoR
, click "Local Changes". Among the changes, there is the submoduleS
marked as "M". Right-clickS
and in the context menu click "Discard submodule changes". The last action deletesCMakeUserPresets.json
, but does not deletenew_dir
with its files.I would like
CMakeUserPresets.json
to remain intact (the same waynew_dir
is) when clicking "Discard submodule changes" in the main repo. Imagine that this is a new configuration file that has just been added to the working copy, but not staged yet. When discarding submodule changes and then switching to other branch, I'd like to use the same configCMakeUserPresets.json
for other branches.CMakeUserPresets.json
is a good candidate for adding to .gitignore inS
, but while that has not been done, it would be nice if Fork did not delete unstaged files.