# Manually edit the commit a submodule is pointing to?

3 messages from 2010-04-12 to 2010-04-12. Participants: Tim Visher, Shawn O. Pearce.
Thread: https://gitlist.dev/t/23429

## Tim Visher, 2010-04-12 14:31

Subject: Manually edit the commit a submodule is pointing to?
Message-ID: <i2jc115fd3c1004120731g950c127fn44603df222de8273@mail.gmail.com>
URL: https://gitlist.dev/e/i2jc115fd3c1004120731g950c127fn44603df222de8273%40mail.gmail.com

```
Hello Everyone,

I recently began to use submodules to manage large packages that I
depend on from my .emacs file and I've run into an issue where I made
a change locally and didn't push out to the master repo.  I'm now not
at that box and I'm trying to checkout the repo fresh.

The problem is that the master repo doesn't have the commit specified…
Where?  So I can't edit the submodule commit and then readd it because
I don't have the submodule to edit since I can't check it out.  Is it
possible to just manually munge the commit that the submodule is
pointing to?

Thanks!

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

```

## Shawn O. Pearce, 2010-04-12 14:47

Subject: Re: Manually edit the commit a submodule is pointing to?
Message-ID: <20100412144718.GC6313@spearce.org>
URL: https://gitlist.dev/e/20100412144718.GC6313%40spearce.org
In-Reply-To: <i2jc115fd3c1004120731g950c127fn44603df222de8273@mail.gmail.com>

```
Tim Visher <tim.visher@gmail.com> wrote:
> I recently began to use submodules to manage large packages that I
> depend on from my .emacs file and I've run into an issue where I made
> a change locally and didn't push out to the master repo.  I'm now not
> at that box and I'm trying to checkout the repo fresh.
> 
> The problem is that the master repo doesn't have the commit specified…
> Where?  So I can't edit the submodule commit and then readd it because
> I don't have the submodule to edit since I can't check it out.  Is it
> possible to just manually munge the commit that the submodule is
> pointing to?

Yup:

  git update-index --cacheinfo 160000 commit path

-- 
Shawn.

```

## Tim Visher, 2010-04-12 18:19

Subject: Re: Manually edit the commit a submodule is pointing to?
Message-ID: <g2yc115fd3c1004121119l404caf8coa376d7561f130a3b@mail.gmail.com>
URL: https://gitlist.dev/e/g2yc115fd3c1004121119l404caf8coa376d7561f130a3b%40mail.gmail.com
In-Reply-To: <20100412144718.GC6313@spearce.org>

```
On Mon, Apr 12, 2010 at 10:47 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
> Tim Visher <tim.visher@gmail.com> wrote:
>> I recently began to use submodules to manage large packages that I
>> depend on from my .emacs file and I've run into an issue where I made
>> a change locally and didn't push out to the master repo.  I'm now not
>> at that box and I'm trying to checkout the repo fresh.
>>
>> The problem is that the master repo doesn't have the commit specified…
>> Where?  So I can't edit the submodule commit and then readd it because
>> I don't have the submodule to edit since I can't check it out.  Is it
>> possible to just manually munge the commit that the submodule is
>> pointing to?
>
> Yup:
>
>  git update-index --cacheinfo 160000 commit path

Thanks, Shawn.  That worked great.

-- 

In Christ,

Timmy V.

http://burningones.com/
http://five.sentenc.es/ - Spend less time on e-mail

```
