
#PROJECT=hopeless-lazarus
PROJECT=$1

BRANCH=main

# https://stackoverflow.com/a/9683337/18595765

git config --global init.defaultBranch $BRANCH

pushd $PROJECT

#BRANCH=$(git symbolic-ref --short HEAD)

rm -rf .git

endlines linux -r -v .

git init
git add .
git commit -m "Clear history"

git remote add origin git@codeberg.org:rchastain/$PROJECT.git
git push -u --force origin $BRANCH

popd

exit 0

pushd /home/roland/Documents/git/eschecs
BRANCH=$(git symbolic-ref --short HEAD) # https://stackoverflow.com/a/10915331
echo $BRANCH
popd

if [ $BRANCH == "main" ]; then
  echo "OK"
fi
