Skip to content

Instantly share code, notes, and snippets.

@uchks
Last active January 31, 2023 07:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uchks/9742c2c1211bb55480b37d506cbccc1f to your computer and use it in GitHub Desktop.
Save uchks/9742c2c1211bb55480b37d506cbccc1f to your computer and use it in GitHub Desktop.

Clear Commit History:

  • Remove the history
rm -rf .git
  • Recreate the repos from the current content only
git init -b main
git add .
git commit -m "Initial commit"
  • Push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:revisitable/<repo>.git
git push -u --force origin main

Pull Upstream:

  • Fetch Upstream
git fetch upstream
  • Check out main
git checkout main
  • Merge changes
git merge upstream/main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment