Solucionado (ver solução)
Solucionado
(ver solução)
6
respostas

Problemas com o Git Commit

$ git commit -m "Protecao com Spring Security" error: invalid object 100644 153c9335ebd71e66178495914ea0d42e367b909c for '.gitignore' error: invalid object 100644 153c9335ebd71e66178495914ea0d42e367b909c for '.gitignore' error: Error building trees

Bom dia Pessoal, alguém já teve este erro? Como resolveram? Obrigada

6 respostas

Oi Virginia,

Parece que deu algum problema no seu repositório Git.

Execute esse comando para ver se resolve:

git hash-object -w .gitignore

E na sequencia tente fazer um git add e git commit

oi Rodrigo, Obrigada por ajudar. Porém ele continua com o mesmo erro. Segue abaixo.

Eclipse - Estudos/Java/Curso Alura/Spring Boot API REST/forum (main) $ git hash-object -w .gitignore warning: LF will be replaced by CRLF in .gitignore. The file will have its original line endings in your working directory 29f81acc470dd4e7d6b78285c4672c86ff0e7022

Eclipse - Estudos/Java/Curso Alura/Spring Boot API REST/forum (main) fatal: failed to read object 153c9335ebd71e66178495914ea0d42e367b909c: Invalid argument

Eclipse - Estudos/Java/Curso Alura/Spring Boot API REST/forum (main) $ git commit -m 'teste' error: invalid object 100644 153c9335ebd71e66178495914ea0d42e367b909c for '.gitignore' error: invalid object 100644 153c9335ebd71e66178495914ea0d42e367b909c for '.gitignore' error: Error building trees

Eclipse - Estudos/Java/Curso Alura/Spring Boot API REST/forum (main) $

Roda então esse comando e posta aqui o resultado: git fsck --full

$ git fsck --full error: unable to open .git/objects/15: Invalid argument Checking object directories: 100% (256/256), done. error: HEAD: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: HEAD: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: HEAD: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: HEAD: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: HEAD: invalid reflog entry d72a233263c2c50e67daf52f57152541db09b99a error: HEAD: invalid reflog entry d72a233263c2c50e67daf52f57152541db09b99a error: refs/heads/main: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: refs/heads/main: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: refs/heads/main: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: refs/heads/main: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: refs/heads/main: invalid reflog entry d72a233263c2c50e67daf52f57152541db09b99a error: refs/heads/main: invalid reflog entry d72a233263c2c50e67daf52f57152541db09b99a error: refs/remotes/origin/main: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: refs/remotes/origin/main: invalid reflog entry c18c7ae2b222c9d8019c7394f5e8bfb574113403 error: refs/remotes/origin/main: invalid reflog entry 939717cb351d579dfd11042a4b2bb49c270c65ac error: refs/remotes/origin/main: invalid reflog entry 939717cb351d579dfd11042a4b2bb49c270c65ac dangling tree 024db8774d8c1e8f8b43a97992089dd81aaa4243 dangling blob 009672003d3e881cdb805a58e94290a89a368d90 dangling tree 0419900e2f86321b73644b2e7edadf9814815ee0 dangling blob 063c5d22b4069305e1ce14c17ad1adeb74f3c384 dangling tree 02abc00d3cb1d2120b69dcdba16ce7280cb2bcbb dangling tree 078d2f2c7dc2c670ba3443f1cabc139cf247095f dangling tree 07b81602fcc9f3ce6900e5788d84a7e0c31b288b dangling tree 0ea5cb8dddff80a0b87870b3eb81838aa430c21a dangling tree 0bbe867d869f36b67bb6ade37aa632c66d50ef82 dangling blob 076e40b84531f41d094a31b40d9dc14a3c14e1ba dangling commit 0fe064727e8c8cb799cea7824d1a4acd732b0696 dangling tree 0d297fa2653d6f77887b41cbde332765e11a74e1 missing blob 153c9335ebd71e66178495914ea0d42e367b909c missing blob ff45c931b50e225c08dfa1622ba5a7efff9a8773 missing blob 170453e0e8744dcf3e06c9ca828dd1591c990fdb missing blob 2cb1dcdb1a3ff49f691c849923554efd97961654 missing blob 317cbf9c1c62cbf8bce6ff19c295a3094e5db47c missing blob 3af0ec16a37678d2bc4ea91ac90b515feb3a4aab

Blz, tem uns registros "corrompidos" no repositório.

Roda esse: git reflog expire --stale-fix --all e depois novamente o git fsck --full

solução!

Oi Rodrigo, eu resolvi meu problema, porém da seguinte forma, fiz do clone do meu projeto e substitui no atual e atualizei com a pasta src que baixei e refiz o commit, e também coloquei as dependências novamente. Muito obrigada viu.

abraços,