Those are two conflicting goals:
- delete the history implies a brand new repo (- rm -Rf .git,- git init .): that means you have to force push your new local repo with a- git push --force, destroying the history on the remote repo as well,
 
- keeping the remote repo intact means locally working with - git clone --depth 1, which is safe to do since Git 2.0, as I have documented here (ie. you can push back to a remote repo from a local shallow repo)
 
The second approach seems the safest for:
- preserving the remote repo
- optimizing disk space locally
Note: for a local repo with its full history, git gc and git repack alone are not enough to really shrink the size of a .git folder.
See "git gc --aggressive vs git repack".
git gc
git repack -Ad      # kills in-pack garbage
git prune           # kills loose garbage
(That would not do much on a freshly cloned repo, that would only be effective on a local repo you have been working for some time)
Plus, if you did in the past operations like git filter-branch, your .git folder would still keep a folder like .git/refs/original/ that you need to delete if you want to reduce the size of .git/.
AFAIU the original question and how I want to do it is precisely without removing .git folder, just removing local copy of git log data to make its' state identical to the state after git clone --depth 1
See "Converting git repository to shallow?"
You can try:
cd /my/repo
git show-ref -s HEAD > .git/shallow
git reflog expire --expire=0
git prune
git prune-packed