Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.3k views
in Technique[技术] by (71.8m points)

setting git submodule to a commit after cloning

I'm working on a project which uses other repos which I add as submodules. What I want to do is to set submodules to specific commits after the user clones my repo. Here is what I'm talking about

MyProject
|
|--src
|--submodules
   |--submodule-1 # at commit-1234
   |--submodule-2 # at commit-5678
   |--submodule-3 # at commit-0198

So when some random user clones my project I want that user to have submodules in the same state, i.e. at the same commits. Is it possible? In other words when the use runs

git clone <url to MyProject> --recursive

(s)he gets the repo in the state shown above?

I've been looking online for some time now and can't find an answer. I'm pretty sure it is possible, I'm just not using the right search criteria

question from:https://stackoverflow.com/questions/65837254/setting-git-submodule-to-a-commit-after-cloning

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...