Skip to content

Switching to a branch displays information about missing submodule, then puts the repository in a strange state #21005

Closed

Description

@vchelaru

The problem

For some reason switching my branch on a particular repository is failing, then changing thousands of files which take minutes to revert.

Release version

3.5.2 (x64)

Operating system

Windows 11

Steps to reproduce the behavior

  1. Clone https://github.com/vicdotexe/Gum locally
  2. Fetch and make sure you are on master
  3. Attempt to switch branch to origin/vic/theming-new
  4. Wait a moment

Observe Problem 1: Message about submodules
Observe Problem 2: User is switched back to master rather than the desired branch
Observe Problem 3: Thousands of files have changed

Expected behavior: User should be on the new branch, with no local changes, if necessary submodules pulled

Log files

2025-09-14.desktop.production.log

Screenshots

14_09.55.54.mp4

Additional context

This repository is a fork of one of my own repositories, but I have it cloned to a totally different folder so it should not interfere.

Activity

  1. added
    triage
    on Sep 14, 2025
  2. added
    bug
    priority-2
    and removed
    triage
    on Sep 17, 2025
  3. self-assigned this
    on Oct 27, 2025
  4. sergiou87 commented on Oct 28, 2025

    @sergiou87
    Member

    Thank you for your report!!

    I can reproduce this. I think the problem is we use git checkout --recurse-submodules to check out the new branch, which updates existing submodules. In this case, that branch has a new submodule that needs to be initialized first.

    Doing git checkout (without --recurse-submodules) and then running git submodule update --init --recursive seems to work fine, but we'll look into this and see if that's the right way to fix this 🤔

  5. sergiou87 commented on Feb 19, 2026

    @sergiou87
    Member

    Fixed via #21188 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugpriority-2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions