Debian force push to Github and Gitlab auth via ssh

Step 1: Install git and config ssh_key

## In your repo root directory 

git config --local user.name "ookangzheng" 
git config --local user.email "[email protected]"

git remote add origin [email protected]:ookangzheng/dbl-oisd-nl.git

Step 2: Github repo ssh key

## Debian 10, generate ssh key

ssh-keygen -t rsa -b 4096 -C "xxx.com"
Github screenshot
Gitlab screenshot

Step 3: Push file to origin (without commit history)

git reflog expire --expire=now --all
git repack -ad
git prune

git checkout --orphan "temp"
git add .
git commit -m "Hosts update"
git branch -D master
git branch -m master
git push -f origin master

Photo by Headway on Unsplash