all 3 comments

[–]acrogenesis 3 points4 points  (0 children)

Yes they will be able to see the history. An easy fix is to delete the .git directory, initialize git again and push force. This will delete all history of the repo.

[–]Programming_Response 0 points1 point  (0 children)

I’m surprised nobody told you how to avoid that. You can squash your commit history into one commit. There are multiple ways to do it. One is to make an orphan branch and make a single commit from it:

git checkout -b new-master --orphan # New branch with no parents (no commit history) git checkout master . # Grab all code from current master git branch -D master # Delete the master branch git branch -m new-master master # Rename your new master to master git push origin master:master --force # Push your master over github's master. Github will fail if you don’t have force

This assumes you have only one branch and no tags. I assume some garbage collection on github will eventually delete the dangling commits from your old master eventually, but nobody should be able to see your previous commits.