From various authors, just what worked for me.
Safe Method creating an orphan branch
git checkout --orphan TEMP_BRANCH
git add -A
git commit -am "Initial commit"
git branch -D master
git branch -m master
git push -f origin master This will not keep our old commits history around. But if this doesn't work, try the next method below.
Deleting .git and forcing
git clone https://github/heiswayi/myproject.git
cd myproject
git rm -rf .git
git init git remote add origin https://github.com/heiswayi/myproject.git git remote -v
git add --all git commit -am "Initial commit"
git push -f origin master NOTE: You might need to provide the credentials for your GitHub account.