threads / discuss / 55081

Recover a git repo after accidentally deleting some hash files located under .git/objects.

Subject: Recover a git repo after accidentally deleting some hash files located under .git/objects.

## tl;dr

6 messages between Feb 1, 2021 and Feb 1, 2021.

replies: 5people: 3as markdown or json

Hongyi Zhao· Feb 1, 2021, 02:14 UTC · lore
Hi,

I accidentally deleted some hash files located under the project's .git/objects subdirectory. In this case, can I resume the project?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China
胡哲宁· Feb 1, 2021, 05:56 UTC · re: Hongyi Zhao · lore

Re: Recover a git repo after accidentally deleting some hash files located under .git/objects.

Hi,I don't think so unless you have the commit
 in github or gitlab which include this file,
maybe you can use git pull to get it.
By the way ,you can ask questions in irc chatroom #git or #git-devel.
There will be a good place to get help.
--
adlternative
Hongyi Zhao <hongyi.zhao@gmail.com> 于2021年2月1日周一 上午10:16写道:
Show 12 quoted lines
>
> Hi,
>
> I accidentally deleted some hash files located under the project's
> .git/objects subdirectory. In this case, can I resume the project?
>
> Regards
> --
> Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
> Theory and Simulation of Materials
> Hebei Polytechnic University of Science and Technology engineering
> NO. 552 North Gangtie Road, Xingtai, China
Hongyi Zhao· Feb 1, 2021, 07:01 UTC · re: 胡哲宁 · lore

Re: Recover a git repo after accidentally deleting some hash files located under .git/objects.

On Mon, Feb 1, 2021 at 1:54 PM 胡哲宁 <adlternative@gmail.com> wrote:
Show 6 quoted lines
>
> Hi,I don't think so unless you have the commit
>  in github or gitlab which include this file,
> maybe you can use git pull to get it.
> By the way ,you can ask questions in irc chatroom #git or #git-devel.
> There will be a good place to get help.

Thanks a lot for your suggestion. BTW, what's IRC client and server used by you normally?

Show 16 quoted lines
> --
> adlternative
>
> Hongyi Zhao <hongyi.zhao@gmail.com> 于2021年2月1日周一 上午10:16写道:
> >
> > Hi,
> >
> > I accidentally deleted some hash files located under the project's
> > .git/objects subdirectory. In this case, can I resume the project?
> >
> > Regards
> > --
> > Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
> > Theory and Simulation of Materials
> > Hebei Polytechnic University of Science and Technology engineering
> > NO. 552 North Gangtie Road, Xingtai, China
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China
胡哲宁· Feb 1, 2021, 07:31 UTC · re: Hongyi Zhao · lore

Re: Recover a git repo after accidentally deleting some hash files located under .git/objects.

oh,I am using Konversation,it's a good irc client. You can also use weechat in terminal. And http://quhno.internetstrahlen.de/Vivaldi/freenode-help.html may have many helpful usages for you to learn irc command.

说句中文活跃下气氛 :)
Hongyi Zhao <hongyi.zhao@gmail.com> 于2021年2月1日周一 下午3:01写道:
Show 36 quoted lines
>
> On Mon, Feb 1, 2021 at 1:54 PM 胡哲宁 <adlternative@gmail.com> wrote:
> >
> > Hi,I don't think so unless you have the commit
> >  in github or gitlab which include this file,
> > maybe you can use git pull to get it.
> > By the way ,you can ask questions in irc chatroom #git or #git-devel.
> > There will be a good place to get help.
>
> Thanks a lot for your suggestion. BTW, what's IRC client and server
> used by you normally?
>
> > --
> > adlternative
> >
> > Hongyi Zhao <hongyi.zhao@gmail.com> 于2021年2月1日周一 上午10:16写道:
> > >
> > > Hi,
> > >
> > > I accidentally deleted some hash files located under the project's
> > > .git/objects subdirectory. In this case, can I resume the project?
> > >
> > > Regards
> > > --
> > > Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
> > > Theory and Simulation of Materials
> > > Hebei Polytechnic University of Science and Technology engineering
> > > NO. 552 North Gangtie Road, Xingtai, China
>
>
>
> --
> Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
> Theory and Simulation of Materials
> Hebei Polytechnic University of Science and Technology engineering
> NO. 552 North Gangtie Road, Xingtai, China
Michal Suchánek· Feb 1, 2021, 09:51 UTC · re: 胡哲宁 · lore

Re: Recover a git repo after accidentally deleting some hash files located under .git/objects.

On Mon, Feb 01, 2021 at 01:56:55PM +0800, 胡哲宁 wrote:
> Hi,I don't think so unless you have the commit
>  in github or gitlab which include this file,
> maybe you can use git pull to get it.
How?
fetch/pull complains that the hashes are missing.

In this situation I just delete the repository but it is kind of stupid that git rells you exactly what is wrong but won't fix it.

Thanks
Michal
胡哲宁· Feb 1, 2021, 10:02 UTC · re: Michal Suchánek · lore

Re: Recover a git repo after accidentally deleting some hash files located under .git/objects.

Michal Suchánek <msuchanek@suse.de> 于2021年2月1日周一 下午5:51写道:
Show 12 quoted lines
>
> On Mon, Feb 01, 2021 at 01:56:55PM +0800, 胡哲宁 wrote:
> > Hi,I don't think so unless you have the commit
> >  in github or gitlab which include this file,
> > maybe you can use git pull to get it.
> How?
>
> fetch/pull complains that the hashes are missing.
>
> In this situation I just delete the repository but it is kind of stupid
> that git rells you exactly what is wrong but won't fix it.
>

Is it so? I thought it would work normally, and I hope git can fix it one day. Thanks.

ZheNing Hu
> Thanks
>
> Michal

← back to recent threads