You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
399 B

#!/usr/bin/env bash
echo "RepoClean"
branch=$(git branch --show-current)
gitremote=$(git remote -v | grep '(push)')
name=$(echo $gitremote | awk '{print $1}')
remote=$(echo $gitremote | awk '{print $2}')
echo "Remote: $remote"
rm -rf .git
git init
git checkout -b $branch
git add .
git commit -m 'Initial commit'
git remote add $name $remote
git push -u --force $name $branch
echo "Complete"