How to Remove Git repository and push new one

Viewed 13012

how can I Clear repository and push new one instead of it .

I have project with size more than 2GB , I checked .git folder and it's size is 1.5GB , I try to delete .git folder after that I did git init and force push project , but remote repository size not changed , my steps :

git init
git add . 
git commit -m "First Push"
git remote add origin http://Url_here
git push -f origin master

how to replace repository content ?

3 Answers

log in as root remove .git

sudo rm -R .git

Log in as correct user

git init
git remote add origin https://[name]@bitbucket.org/frankdesign/[new-repo].git
git add .
git commit -m "new clean repo"
git push --force origin master
Related