# git submodule update needs to be at the toplevel of working tree, why?

3 messages from 2013-11-22 to 2013-11-22. Participants: Odin Hørthe Omdal, John Keeping.
Thread: https://gitlist.dev/t/35392

## Odin Hørthe Omdal, 2013-11-22 13:22

Subject: git submodule update needs to be at the toplevel of working tree, why?
Message-ID: <1385126550.10973.50760825.6B70B959@webmail.messagingengine.com>
URL: https://gitlist.dev/e/1385126550.10973.50760825.6B70B959%40webmail.messagingengine.com

```
Hi,

I'm usually in a subfolder doing actual work. A very common problem I
have is wanting to do a submodule update, but git really hates that. And
I wonder why?

It wouldn't be hard to cd to the toplevel working directory, do the
update, and cd back. It's what I have to do manually every time now
already:


  $ git submodule update
  You need to run this command from the toplevel of the working tree.

  $ cd ../..

  $ git submodule update
  Submodule path 'myproject/libs/external-module': checked out
  '434fdf32a7add62...

  $ cd -


I see that it comes from git-sh-setup, so no rationale for this rather
weird and surprising behavior is given in the git-submodule file. :)

-- 
  Odin Hørthe Omdal
  odinho@opera.com

```

## John Keeping, 2013-11-22 13:47

Subject: Re: git submodule update needs to be at the toplevel of working tree, why?
Message-ID: <20131122134747.GC15033@serenity.lan>
URL: https://gitlist.dev/e/20131122134747.GC15033%40serenity.lan
In-Reply-To: <1385126550.10973.50760825.6B70B959@webmail.messagingengine.com>

```
On Fri, Nov 22, 2013 at 02:22:30PM +0100, Odin Hørthe Omdal wrote:
> I'm usually in a subfolder doing actual work. A very common problem I
> have is wanting to do a submodule update, but git really hates that. And
> I wonder why?
> 
> It wouldn't be hard to cd to the toplevel working directory, do the
> update, and cd back. It's what I have to do manually every time now
> already:

This restriction was removed in Git 1.8.4.

```

## Odin Hørthe Omdal, 2013-11-22 14:37

Subject: Re: git submodule update needs to be at the toplevel of working tree, why?
Message-ID: <1385131020.5838.50791533.395F2F63@webmail.messagingengine.com>
URL: https://gitlist.dev/e/1385131020.5838.50791533.395F2F63%40webmail.messagingengine.com
In-Reply-To: <20131122134747.GC15033@serenity.lan>

```
On Fri, Nov 22, 2013, at 14:47, John Keeping wrote:
> On Fri, Nov 22, 2013 at 02:22:30PM +0100, Odin Hørthe Omdal wrote:
> > I'm usually in a subfolder doing actual work. A very common problem I
> > have is wanting to do a submodule update, but git really hates that. And
> > I wonder why?
> > 
> > It wouldn't be hard to cd to the toplevel working directory, do the
> > update, and cd back. It's what I have to do manually every time now
> > already:
> 
> This restriction was removed in Git 1.8.4.

Oh, awesome!  My system git is 1.8.3.2.

I'll do a manual install then :)

Sorry for the noise. (I didn't find any earlier talk about it, but I
only used gmame's search, so it might have missed something)

-- 
  Odin Hørthe Omdal
  odinho@opera.com

```
