Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6380423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:15:55+00:00 2026-05-25T02:15:55+00:00

Assuming the following project layout:- mainrepo_git |____ .git |____ .gitmodules |____ proj <——- directory

  • 0

Assuming the following project layout:-

mainrepo_git
    |____ .git
    |____ .gitmodules
    |____ proj            <------- directory containing the code files for mainrepo
            |____ 3rdpartysourcecode <-- directory containing upstream open source code
            |      |____ .git
            |      |____ 3rdpartyfiles
            |
            |____ mainrepofilesanddirectories  

mainrepo_git contains source code I am directly responsible for. I have read/write access and can push and pull directly to a remote git repository which I manage.

Nested inside mainrepo_git is a directory which I named 3rdpartysourcecode. This 3rdpartysourcecode directory is in fact another git repo (also commonly referred to as a “git submodule”) which is pointing to an open source 3rd party git repository managed by other developers. I only have read access to it. No write access.

Is there any way of ‘freezing’ a specific commit hash of the git submodule in relation to a commit made in my main repository?

For example, if I am at (or I revert to) commit a12ucak in my mainrepo, my git submodule also gets reverted to a specific version which I tie to commit a12ucak? And when I switch to commit b349jdsak, my git submodule also gets reverted to a version which I tie to b349jdsak?

So my question is: there is a way to create a linkage between a specific commit in the main repo with a corresponding commit in the git submodule? In such a way where when I checkout that specific commit in the main git repo, the corresponding commit in the git submodule will also be checkout.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:15:56+00:00Added an answer on May 25, 2026 at 2:15 am

    Freezing is the whole point of submodules. You should really read a tutorial on it. In a nutshell, git add 3rdpartysourcecode (important no trailing slash!) followed by a commit locks the currently checked out submodule commit to the supermodule commit. Then later you use git submodule update to check out that revision.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Assuming that I have the following directory structure for a Python project: config/ scripts/
Assuming the following directory structure, htdocs/ images/ css/ .htaccess system/ index.php ... I would
I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency
Assuming A.sql contains the following code, then second Select query won’t be executed due
The directory structure of my Silverlight project is like the following: \Bin - MainModule.xap
I have a Python project with the following directory structure: project/ project/src/ project/src/somecode.py project/src/mypackage/mymodule.py
Assuming the URL is http://localhost:8080/project-name/resource.xhtml , I want to obtain the following http://localhost:8080/project-name in
The following code (packaged in a 'Console Application' Visual Studio project): using System; using
Assuming following definition: /// <summary> /// Replaces each occurrence of sPattern in sInput with
Assuming the following class stub: public class Foo<T> { private Class<T> type; public Foo<T>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.