My working git repository is broken, it lose track to all the files in it, i.e.
$ git log fatal: bad default revision 'HEAD'
$ git status ... told me that all the files are new
However the .git directory does contain my objects.
$ du -sh .git 34M .git
$ git count-objects 4151 objects, 32692 kilobytes
$ git --version git version 1.6.0.4
The last thing I remember doing before it went wrong was creating (clone --mirror) a backup repository at an NFS-mounted server. However the backup repository cloned is broken the same way.
How can I restore my repository?
In the top right corner of GitHub.com, click your profile photo, then click Your organizations. Next to the organization, click Settings. In the left sidebar, click Deleted repositories. Next to the repository you want to restore, click Restore.
Fix 5 - Git - remote: Repository not found Just run the git remote update command which updates the local repo with the remote repo and its credentials. If this command is executed without any issues then your issue will be resolved.
It stands for File System ChecK. The name is taken from the Unix fsck command, which is used to validate a file system.
Try to check if each of your files in .git/ are owned by current user.
I had the same problem, when realizing I made some commits with root user, and that created objects (under .git/objects) where belongig to root, trigering errors when running git as regular user.
This command solved the problem:
sudo chown jb:jb .git/ -R *
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With