threads / discuss / 23429

Manually edit the commit a submodule is pointing to?

Subject: Manually edit the commit a submodule is pointing to?

## tl;dr

3 messages between Apr 12, 2010 and Apr 12, 2010.

replies: 2people: 2as markdown or json

Tim Visher· Apr 12, 2010, 14:31 UTC · lore
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· Apr 12, 2010, 14:47 UTC · re: Tim Visher · lore

Re: Manually edit the commit a submodule is pointing to?

Tim Visher <tim.visher@gmail.com> wrote:
Show 10 quoted lines
> 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· Apr 12, 2010, 18:19 UTC · re: Shawn O. Pearce · lore

Re: Manually edit the commit a submodule is pointing to?

On Mon, Apr 12, 2010 at 10:47 AM, Shawn O. Pearce <spearce@spearce.org> wrote:
Show 15 quoted lines
> 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

← back to recent threads