Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. push the branch

  2. find a previous commit of the commit that added the sensitive data and copy the commit hash

  3. hard-reset

    Code Block
    git reset --hard <commit-hash>
  4. force-push

    Code Block
    git push -f

...

  1. create a local back up branch in case the branch is messed up

  2. switch to the branch of the PR that has the sensitive data

  3. make a commit to delete the sensitive data if you have not and push the branch (this is for the sensitive data not to show on GitHub after force-pushing)push the branch

  4. rewrite commit history using git rebase -i
    (https://docs.github.com/en/get-started/using-git/using-git-rebase-on-the-command-line)

  5. force-push

...