
I often use a larger Visual Studio solutions to handle a bunch of simple NuGet projects. And more often I only update references or NuGet packages.
But working with git submodules in VSCode and Visual Studio is still a pain in the apple….
Thanks got we have a foreach support inside of git submodule
So here is a simple snippet to update, commit and push all submodules inside a parent directory.
1# Add all changes
2git submodule foreach "git add ."
3# Commit all changes, use 'true' to ignore submodules without changes
4git submodule foreach "git commit -m 'Updated all NuGet references' || true"
5# Push all changes
6git submodule foreach "git push origin master"
For sure this wont work inside a team, because you cannot push to master. But for personal simple project I do not use any branch security / policy.
Related articles

Aug 20, 2025 · 5 min read
Use SSH for Git Authentication in Azure DevOps
If you work with Azure DevOps Git repos, SSH is often the simplest, most secure and most policy‑friendly way to authenticate. Many …

Feb 10, 2024 · 2 min read
Top 5 Git Commit Message Best Practises in 2024
When you join a project as a new developer, you see one thing above all: no standards for Git commit messages. Some put emojis in the …
Let's Work Together
Looking for an experienced Platform Architect or Engineer for your next project? Whether it's cloud migration, platform modernization or building new solutions from scratch - I'm here to help you succeed.

Comments