# check if branch is clean
git status -s
# create branch with no history
git checkout --orphan flattened
git add -A
git commit -m "flattened"
# git status -s
git diff main..flattened
# !!! This will overwrite remote main branch !!!
git push origin +flattened:master
# >>> remove all files from the directory <<< and set up the git:
git init .
git remote add origin https://github.com/_LOGIN_/_REPO_.git
git config user.name "_LOGIN_"
git config user.email "_EMAIL_"
git checkout main
git commit --allow-empty -m "empty"
git add -A
git stash
git branch --set-upstream-to=origin/main
git reset --hard origin/main
git fetch --all
git pull origin main
git push -u origin main