threads / discuss / 12998

Updating submodules

Subject: Updating submodules

## tl;dr

4 messages between Apr 5, 2008 and Apr 5, 2008.

replies: 3people: 2as markdown or json

Pat Maddox· Apr 5, 2008, 22:46 UTC · lore

Do I need to cd into each submodule dir and fetch/rebase? git submodule update doesn't seem to do anything, though I would assume it's used to update the submodules...

Pat
Avery Pennarun· Apr 5, 2008, 23:01 UTC · re: Pat Maddox · lore

Re: Updating submodules

On 4/5/08, Pat Maddox <pergesu@gmail.com> wrote:
> Do I need to cd into each submodule dir and fetch/rebase?  git
>  submodule update doesn't seem to do anything, though I would assume
>  it's used to update the submodules...

"git submodule update" updates each submodule to the version that was checked into the supermodule. It doesn't do anything like fetch, rebase, or pull.

Avery
Pat Maddox· Apr 5, 2008, 23:08 UTC · re: Avery Pennarun · lore

Re: Updating submodules

On Sat, Apr 5, 2008 at 4:01 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 9 quoted lines
>
> On 4/5/08, Pat Maddox <pergesu@gmail.com> wrote:
>  > Do I need to cd into each submodule dir and fetch/rebase?  git
>  >  submodule update doesn't seem to do anything, though I would assume
>  >  it's used to update the submodules...
>
>  "git submodule update" updates each submodule to the version that was
>  checked into the supermodule.  It doesn't do anything like fetch,
>  rebase, or pull.

Okay. So I've got a parent repo with three submodules. I've been working in one submodule and have been committing changes. Now I wanted to get the latest changes upstream...I have to rebase that repo individually, right?

Pat
Avery Pennarun· Apr 5, 2008, 23:11 UTC · re: Pat Maddox · lore

Re: Updating submodules

On 4/5/08, Pat Maddox <pergesu@gmail.com> wrote:
Show 15 quoted lines
> On Sat, Apr 5, 2008 at 4:01 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
>  >
>  > On 4/5/08, Pat Maddox <pergesu@gmail.com> wrote:
>  >  > Do I need to cd into each submodule dir and fetch/rebase?  git
>  >  >  submodule update doesn't seem to do anything, though I would assume
>  >  >  it's used to update the submodules...
>  >
>  >  "git submodule update" updates each submodule to the version that was
>  >  checked into the supermodule.  It doesn't do anything like fetch,
>  >  rebase, or pull.
>
> Okay.  So I've got a parent repo with three submodules.  I've been
>  working in one submodule and have been committing changes.  Now I
>  wanted to get the latest changes upstream...I have to rebase that repo
>  individually, right?

Yes. Be careful of which branch your submodule is on; if "git submodule update" has done anything in the past, you might not be on a branch at all, in which case you have to create a local branch with your changes before you can safely rebase or push.

Avery

← back to recent threads