progit / progit2

Pro Git 2nd Edition
Other
5.91k stars 1.94k forks source link

git add error #1941

Closed genvictpeter closed 8 months ago

genvictpeter commented 8 months ago

There's no existing/similar bug report.

This report is about a single actionable bug.

This report is about the ProGit book, version 2, English language.

Bug covers book website/pdf

Problem is present in the Pro Git book on the website?

Which version of the book is affected?

Source files

Describe the bug:

root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo# git add . error: short read while indexing yxsafety/demo/main.c error: yxsafety/demo/main.c: failed to insert into database error: unable to index file 'yxsafety/demo/main.c' fatal: adding files failed root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo# git --version git version 2.34.1 root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo#

Steps to reproduce:

root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo# git add . error: short read while indexing yxsafety/demo/main.c error: yxsafety/demo/main.c: failed to insert into database error: unable to index file 'yxsafety/demo/main.c' fatal: adding files failed root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo# git --version git version 2.34.1 root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo#

Expected behavior:

root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo# git add . error: short read while indexing yxsafety/demo/main.c error: yxsafety/demo/main.c: failed to insert into database error: unable to index file 'yxsafety/demo/main.c' fatal: adding files failed root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo# git --version git version 2.34.1 root@YF-XieHui:/mnt/e/project/pingshan/yxsafety/demo#

Screenshots:

No response

Additional context:

No response

Device

No response

Operating system

No response

Browser/application + version

No response

ben commented 8 months ago

Going to close this, it's not a problem we can fix by updating the contents of the Pro Git book.

jnavila commented 8 months ago

I guess the file yxsafety/demo/main.c has some sort of issue.

genvictpeter commented 8 months ago

yxsafety/demo/main.c it's an encryted file,but you shouldn't be unable to git add

genvictpeter commented 8 months ago

I have searched the Internet for a long time, but there is no solution

genvictpeter commented 8 months ago

Going to close this, it's not a problem we can fix by updating the contents of the Pro Git book. I have searched the Internet for a long time, but there is no solution,

jnavila commented 8 months ago

git version 2.34.1 is a pretty old version. Maybe you should try first to update to the latest version.

22dc519f-d18e-4586-9301-92c4c19ff3a8 commented 8 months ago

في الثلاثاء، 19 مارس 2024, 11:32 Jean-Noël Avila @.***> كتب:

git version 2.34.1 is a pretty old version. Maybe you should try first to update to the latest version.

— Reply to this email directly, view it on GitHub https://github.com/progit/progit2/issues/1941#issuecomment-2006941240, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEMVKMU2KHLW2F25CZZGD4LYZAO4XAVCNFSM6AAAAABEZGKV3CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBWHE2DCMRUGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>