stranger555
stranger555

Reputation: 59

Git Repo has hidden files

hi I am in a serious trouble my GIT repository has hidden files and I cant trace them or find them, I have a backup of everything so I removed all the files and folders in the repo(git rm -rf *)

but still when I try to fetch the size of the repo with --

curl -H "Accept: application/vnd.github.v3+json" -s https://api.github.com/repos/MissJuliaRobot/MissJuliaRobot | jq '.size' | numfmt --to=iec --from-unit=1024

It shows 37MB but there are no files, folders nothing.

Upvotes: 0

Views: 4168

Answers (2)

stranger555
stranger555

Reputation: 59

Oh well i fixed it on my own

All i need to do was create a empty branch and add the files(backed up already) and force push them in the empty branch

 git checkout --orphan stable
 git rm -rf .
 git commit --allow-empty -m .
 git push origin stable
 now here i added my files...
 git add .
 git commit -m "fixed"
 git switch stable
 git push -f origin stable

DONE

Upvotes: 0

Edward Thomson
Edward Thomson

Reputation: 78813

Your repository is part of a repository "network". The way forks work, they will share objects on GitHub's servers for space savings. Because you have 38 forks, your repository is part of that network.

Although you have rewritten your history so that your repository - when cloned - doesn't have those objects, your repository network - the way it's stored on github.com - does.

If you really want that number to say 0, you have to not be a part of that network. That means deleting the repository (which will make somebody else the main repository in that network.)

Upvotes: 1

Related Questions