threads / discuss / 47110

submodule using revision

Subject: submodule using revision

## tl;dr

2 messages between Nov 3, 2017 and Nov 3, 2017.

replies: 1people: 2as markdown or json

gregory grey· Nov 3, 2017, 13:42 UTC · lore
Hi guys.

Currently git submodule only works with branch of the submodule in question. Adding a functionality to work with a revision would be great from my point of view.

Proposed syntax is as follows: git submodule add -r commit_sha git://some_repository.git

Thanks!
-- 
http://ror6ax.github.io/
Jacob Keller· Nov 3, 2017, 20:26 UTC · re: gregory grey · lore

Re: submodule using revision

On Fri, Nov 3, 2017 at 6:42 AM, gregory grey <ror6ax@gmail.com> wrote:
Show 16 quoted lines
> Hi guys.
>
> Currently git submodule only works with branch of the submodule in
> question. Adding a functionality to work with a revision would be
> great from my point of view.
>
> Proposed syntax is as follows:
> git submodule add -r commit_sha git://some_repository.git
>
>
> Thanks!
>
>
> --
>
> http://ror6ax.github.io/
You can get similar behavior by doing:

git submodule add -r <branch> <url> cd <subdir> git checkout <commit object id> cd .. git ad <subdir> git commit

Thanks, Jake

← back to recent threads