119. Update Submodule to Latest Commit
Beginner Mode
Start your terminal to use beginner mode.
Scenario:
You have a Git repository at /home/interview/repo that contains a submodule in the vendor/utils directory. The submodule is pointing to an old commit, but newer commits exist on the submodule's remote repository.
Task:
Update the submodule to the latest commit on its default branch and commit this change in the parent repository.
Example:
# Before (submodule at old commit)
$ git submodule status
a1b2c3d vendor/utils (v1.0.0)
$ cd vendor/utils && git log --oneline -1
a1b2c3d Add helper function
# After (submodule updated)
$ git submodule status
e5f6g7h vendor/utils (v1.2.0)
$ cd vendor/utils && git log --oneline -1
e5f6g7h Add advanced features
Terminal requires a larger screen
Open this page on a desktop or tablet (≥ 768px) to launch the terminal and practice hands-on.
Linux Terminal Environment
Write and execute your solution in the terminal below.
Essential
SQL 0/33
Git 0/15
Spark 0/20
Snowflake 0/22
Python 0/24
Need more practice in this area? Explore more questions →
GoDaddy
TCS
X
Accenture
Adobe
Google
LinkedIn
Samsung
Datadog
Wix
Dropbox
Meta
OpenAI
Hulu
Uber
DoorDash
Anthropic
Amazon
ActivisionBlizzard
Vercel
Crypto.Com
Zscaler
DeutscheBank
Apple
BMW
PayPal
Snowflake
AMD
Twilio
Atlassian
JPMorgan
NVIDIA
IBM
Databricks
Coinbase
Cisco
Robinhood
Twitter
Microsoft
Palantir
Netflix
VMware
Cloudflare
Stripe
Capital One
Splunk
Intel
SAP
Tesla
GitHub
JaneStreet
Bloomberg
Salesforce
Elastic
CGI
UBS
GitLab
Ubisoft
Slack
Nintendo
EY
Kayak
Lyft
Airbnb
Walmart
Revolut
Visa
Okta
HashiCorp
Instacart
Mastercard