The list of all the commands that you have executed on your Mac Terminal is stored in the .zsh_history hidden file that you can find in your home directory.
% cat ~/.zsh_history
cd ~/Desktop
mkdir myrepo
cd myrepo
git init
mkdir module1
mkdir module2
cd module1
touch Sample.java
cd ..
cd module2
mkdir Main.java
clear
cd ..
git add .
git commit -m "init commit"
...
...
You can remove this file or open this file with vi/nano editor and clear all the text it has.
% rm ~/.zsh_history
You will need to close and reopen Terminal.
Now when you will run the history command you would not see your command history.
% history
1 history
2 rm ~/.zsh_history

Note - if you want to do this for the bash shell, do the same for ~/.bash_history file.
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!