Reset Repo Commits

Linux

export GIT_RESET_USER=yourUserNameOrOrgName
export GIT_RESET_REPO=yourRepoName
export bypassCF="git"
export bypassCF2="@"
export bypassCF3="github.com"
rm -rf .git
git init
git add .
git checkout -b main
git commit -m "Initial Commit"
git remote add origin $bypassCF$bypassCF2$bypassCF3github.com:$GIT_RESET_USER/$GIT_RESET_REPO.git
git remote set-url origin https://github.com/$GIT_RESET_USER/$GIT_RESET_REPO.git
git push -u --force origin main

Windows

set GIT_RESET_USER=yourUserNameOrOrgName
set GIT_RESET_REPO=yourRepoName
set bypassCF=git
set bypassCF2=@
set bypassCF3=github.com
rd /s /q .git
git init
git add .
git checkout -b main
git commit -m "Initial Commit"
git remote add origin %bypassCF%%bypassCF2%%bypassCF3%:%GIT_RESET_USER%/%GIT_RESET_REPO%.git
git remote set-url origin https://github.com/%GIT_RESET_USER%/%GIT_RESET_REPO%.git
git push -u --force origin main


Revision #4
Created 16 January 2023 22:12:48 by Chase
Updated 28 January 2023 22:34:04 by Chase