Coding⏱️ 2 min read📅 2026-06-03

How to Fix: Is there a way to make git pull automatically update submodules?

Automatically update git submodules with git pull.

Quick Answer: Use the `git config --add remote.origin.updateSubmodules true` command to enable submodule updates on every pull.

To automatically update submodules on every git pull, you can utilize a Git alias or modify your .gitconfig file. This process involves using the `update-submodule` command to initialize and update submodules.

🛑 Root Causes of the Error

  • The issue arises from the fact that git submodule update is not automatically run during a pull operation.

🛠️ Step-by-Step Verified Fixes

Method 1: Git Alias

  1. Step 1: Create a new alias in your .gitconfig file by adding the following line:
git config --global alias.l 'git submodule update --init'}

Method 2: .gitconfig File

  1. Step 1: Create a new file in your repository's root directory named `.gitmodules` and add the following line to it:
[submodule

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions