Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Untracked files in sunmodule

Mahmoud
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 16, 2024

Hello

i have problem that i have one branch(calc branch) with submodules and i have merged this branch with Release Branch and the project goes on but later i decided to switch back to that branch(calc branch) the source tree doesn't allow me to do that saying there is untracked file even i'm sure i have committed everything but i noticed the .gitmodules file is different in both Branch what should i do to solve this problem and able to switch to the other branch.

1 answer

0 votes
Martin Runge
Community Champion
June 17, 2026

Hi @Mahmoud

Welcome to the Atlassian community!

Switching branches fails because Git blocks modifications when the target branch contains different submodule commit mappings. Cleaning untracked build files using git submodule foreach --recursive git clean -xfd and updating pointers via git submodule update --init --recursive immediately forces your submodules to align with your active branch and clears the checkout error.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events