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
Actually d9845e8f081b7663cbd9d9b08c65b782bcc3d866 is the latest commit from the main repository, It only updated the submodule with no other actions. However, the argument --prune will cause the latest commit to fall back.
And even if you use checkout alone, manually using the command git submodule update --init will not work. It will still force an overwrite. Unless you use git submodule update --init --remote, but that doesn't work as intended, because you want to get the version of the latest committed submodule in the current repository.
So far, when we’ve run the git submodule update command to fetch changes from the submodule repositories, Git would get the changes and update the files in the subdirectory but will leave the sub-repository in what’s called a “detached HEAD” state. This means that there is no local working branch (like master, for example) tracking changes. With no working branch tracking changes, that means even if you commit changes to the submodule, those changes will quite possibly be lost the next time you run git submodule update. You have to do some extra steps if you want changes in a submodule to be tracked.
When using parameter -- prune, The detached HEAD will be removed which we just need.
The text was updated successfully, but these errors were encountered:
ykla
changed the title
The parameter --no-recurse-submodules should be disabled when using submodules.
The parameter -- prune should be disabled when using submodules.
May 26, 2024
The parameter
-- prune
should be disabled when using submodules.Now:
But
Actually d9845e8f081b7663cbd9d9b08c65b782bcc3d866 is the latest commit from the main repository, It only updated the submodule with no other actions. However, the argument
--prune
will cause the latest commit to fall back.And even if you use checkout alone, manually using the command
git submodule update --init
will not work. It will still force an overwrite. Unless you usegit submodule update --init --remote
, but that doesn't work as intended, because you want to get the version of the latest committed submodule in the current repository.See also https://git-scm.com/book/en/v2/Git-Tools-Submodules :
When using parameter
-- prune
, Thedetached HEAD
will be removed which we just need.The text was updated successfully, but these errors were encountered: