How to get a list of git submodules of repository before `git clone`?
I'm trying to get a submodule list of a repo before preforming clone.
And then to choose which submodule repo to clone.
Is there any way to do it?
git git-submodules
add a comment |
I'm trying to get a submodule list of a repo before preforming clone.
And then to choose which submodule repo to clone.
Is there any way to do it?
git git-submodules
"git submodule init" "git submodule update"
– Atiq Ur Rehman
Jan 1 at 11:11
Do you want to clone submodules with or without cloning the superproject?
– phd
Jan 1 at 11:59
Yes, but I want to know the list of submodules without cloning the parent repository
– Tomer.Epstein
Jan 1 at 13:16
Not generally, no. But if the parent repository is hosted in a hosting provider like GitHub, Bitbucket, Azure Repos, etc then you could use their API to download the gitmodules file.
– Edward Thomson
Jan 1 at 19:02
add a comment |
I'm trying to get a submodule list of a repo before preforming clone.
And then to choose which submodule repo to clone.
Is there any way to do it?
git git-submodules
I'm trying to get a submodule list of a repo before preforming clone.
And then to choose which submodule repo to clone.
Is there any way to do it?
git git-submodules
git git-submodules
asked Jan 1 at 11:06
Tomer.EpsteinTomer.Epstein
3216
3216
"git submodule init" "git submodule update"
– Atiq Ur Rehman
Jan 1 at 11:11
Do you want to clone submodules with or without cloning the superproject?
– phd
Jan 1 at 11:59
Yes, but I want to know the list of submodules without cloning the parent repository
– Tomer.Epstein
Jan 1 at 13:16
Not generally, no. But if the parent repository is hosted in a hosting provider like GitHub, Bitbucket, Azure Repos, etc then you could use their API to download the gitmodules file.
– Edward Thomson
Jan 1 at 19:02
add a comment |
"git submodule init" "git submodule update"
– Atiq Ur Rehman
Jan 1 at 11:11
Do you want to clone submodules with or without cloning the superproject?
– phd
Jan 1 at 11:59
Yes, but I want to know the list of submodules without cloning the parent repository
– Tomer.Epstein
Jan 1 at 13:16
Not generally, no. But if the parent repository is hosted in a hosting provider like GitHub, Bitbucket, Azure Repos, etc then you could use their API to download the gitmodules file.
– Edward Thomson
Jan 1 at 19:02
"git submodule init" "git submodule update"
– Atiq Ur Rehman
Jan 1 at 11:11
"git submodule init" "git submodule update"
– Atiq Ur Rehman
Jan 1 at 11:11
Do you want to clone submodules with or without cloning the superproject?
– phd
Jan 1 at 11:59
Do you want to clone submodules with or without cloning the superproject?
– phd
Jan 1 at 11:59
Yes, but I want to know the list of submodules without cloning the parent repository
– Tomer.Epstein
Jan 1 at 13:16
Yes, but I want to know the list of submodules without cloning the parent repository
– Tomer.Epstein
Jan 1 at 13:16
Not generally, no. But if the parent repository is hosted in a hosting provider like GitHub, Bitbucket, Azure Repos, etc then you could use their API to download the gitmodules file.
– Edward Thomson
Jan 1 at 19:02
Not generally, no. But if the parent repository is hosted in a hosting provider like GitHub, Bitbucket, Azure Repos, etc then you could use their API to download the gitmodules file.
– Edward Thomson
Jan 1 at 19:02
add a comment |
1 Answer
1
active
oldest
votes
If you want to review the list of submodules of the first level without cloning the superproject download file .gitmodules
from the superproject. You can use git archive
:
git archive --format=tar --remote=$ORIGIN_URL HEAD -- .gitmodules | tar -O -xf -
As submodules could be recursive you have to repeat this for every submodule found in the downloaded .gitmodules
.
After that you can clone any submodule's repository manually.
You may also want to review the list of submodules after cloning the superproject. First, clone without submodules:
git clone $ORIGIN_URL # Don't use `--recursive`
cd <repo_dir>
git submodule init
cat .gitmodules
git submodule update submodule1 submodule2…
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
For non-recursive submodules the first command (git archive
) could be considered one command. But not for recursive submodules.
– phd
Jan 3 at 13:35
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994942%2fhow-to-get-a-list-of-git-submodules-of-repository-before-git-clone%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to review the list of submodules of the first level without cloning the superproject download file .gitmodules
from the superproject. You can use git archive
:
git archive --format=tar --remote=$ORIGIN_URL HEAD -- .gitmodules | tar -O -xf -
As submodules could be recursive you have to repeat this for every submodule found in the downloaded .gitmodules
.
After that you can clone any submodule's repository manually.
You may also want to review the list of submodules after cloning the superproject. First, clone without submodules:
git clone $ORIGIN_URL # Don't use `--recursive`
cd <repo_dir>
git submodule init
cat .gitmodules
git submodule update submodule1 submodule2…
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
For non-recursive submodules the first command (git archive
) could be considered one command. But not for recursive submodules.
– phd
Jan 3 at 13:35
add a comment |
If you want to review the list of submodules of the first level without cloning the superproject download file .gitmodules
from the superproject. You can use git archive
:
git archive --format=tar --remote=$ORIGIN_URL HEAD -- .gitmodules | tar -O -xf -
As submodules could be recursive you have to repeat this for every submodule found in the downloaded .gitmodules
.
After that you can clone any submodule's repository manually.
You may also want to review the list of submodules after cloning the superproject. First, clone without submodules:
git clone $ORIGIN_URL # Don't use `--recursive`
cd <repo_dir>
git submodule init
cat .gitmodules
git submodule update submodule1 submodule2…
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
For non-recursive submodules the first command (git archive
) could be considered one command. But not for recursive submodules.
– phd
Jan 3 at 13:35
add a comment |
If you want to review the list of submodules of the first level without cloning the superproject download file .gitmodules
from the superproject. You can use git archive
:
git archive --format=tar --remote=$ORIGIN_URL HEAD -- .gitmodules | tar -O -xf -
As submodules could be recursive you have to repeat this for every submodule found in the downloaded .gitmodules
.
After that you can clone any submodule's repository manually.
You may also want to review the list of submodules after cloning the superproject. First, clone without submodules:
git clone $ORIGIN_URL # Don't use `--recursive`
cd <repo_dir>
git submodule init
cat .gitmodules
git submodule update submodule1 submodule2…
If you want to review the list of submodules of the first level without cloning the superproject download file .gitmodules
from the superproject. You can use git archive
:
git archive --format=tar --remote=$ORIGIN_URL HEAD -- .gitmodules | tar -O -xf -
As submodules could be recursive you have to repeat this for every submodule found in the downloaded .gitmodules
.
After that you can clone any submodule's repository manually.
You may also want to review the list of submodules after cloning the superproject. First, clone without submodules:
git clone $ORIGIN_URL # Don't use `--recursive`
cd <repo_dir>
git submodule init
cat .gitmodules
git submodule update submodule1 submodule2…
edited Jan 1 at 16:14
answered Jan 1 at 13:29
phdphd
22.7k52544
22.7k52544
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
For non-recursive submodules the first command (git archive
) could be considered one command. But not for recursive submodules.
– phd
Jan 3 at 13:35
add a comment |
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
For non-recursive submodules the first command (git archive
) could be considered one command. But not for recursive submodules.
– phd
Jan 3 at 13:35
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
So, I understand that there's no way doing this in one git command without downloading .gitmodules with third app?
– Tomer.Epstein
Jan 3 at 13:22
For non-recursive submodules the first command (
git archive
) could be considered one command. But not for recursive submodules.– phd
Jan 3 at 13:35
For non-recursive submodules the first command (
git archive
) could be considered one command. But not for recursive submodules.– phd
Jan 3 at 13:35
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53994942%2fhow-to-get-a-list-of-git-submodules-of-repository-before-git-clone%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
"git submodule init" "git submodule update"
– Atiq Ur Rehman
Jan 1 at 11:11
Do you want to clone submodules with or without cloning the superproject?
– phd
Jan 1 at 11:59
Yes, but I want to know the list of submodules without cloning the parent repository
– Tomer.Epstein
Jan 1 at 13:16
Not generally, no. But if the parent repository is hosted in a hosting provider like GitHub, Bitbucket, Azure Repos, etc then you could use their API to download the gitmodules file.
– Edward Thomson
Jan 1 at 19:02