how to fix corrupted git file
Steps to fix
git status
show the empty/corrupt object file
rm .git/objects/08/3834cb34d155e67a8930604d57d3d302d7ec12
remove it
git status
I got fatal: bad object HEAD message
rm .git/index
I remove the index for the reset
git reset
fatal: Could not parse object 'HEAD'.
git status
git pull
just to check whats happening
tail -n 2 .git/logs/refs/heads/MY-CURRENT-BRANCH
prints the last 2 lines tail -n 2 of log branch to show my last 2 commit hash
git update-ref HEAD 7221fa02cb627470db163826da4265609aba47b2
I pick the last commit hash
git status
shows all my file as deleted because i removed the .git/index file
git reset
continue to the reset
git status
verify my fix
Note: The steps starts when I landed on this question and used the answers as reference.
Also in C++:
- check which users are part of a group linux
- yarn
- powershell t admin
- typescript css modules in react
- git remove file from repo that has been added to gitignore
- eslint npm install
- how to get environment variables in powershell
- install graphene federation
- no matches found: *.dmg
- micro linux
- ubuntu restart network manager when ping is low
- escape tty linux keyboard
- restart terminal command line ubuntu
- how to go to previous directory in terminal
- linux psql
- composer require laravel/ui app.css empty
- how can I specific line in ubuntu?
- run exe in proton prefix
- conda install pandas
- npm clean
- wp-cli search-replace
- Adding "0" if clock have one digit
- bash delete first n characters of each line
- github rust action