I tried this but it finds nothing:
history | grep "^git"
This finds too many lines:
history | grep "git"
The history command shows numbers before the actual commands so try using this awk command instead:
history
awk
history | awk '$2 == "git"'
Or
history | awk '$2 ~ /^git/'
You can also just search ~/.bash_history but the contents of this file may not always reflect the current history:
~/.bash_history
grep '^git' ~/.bash_history
The
historycommand shows numbers before the actual commands so try using thisawkcommand instead:Or
You can also just search
~/.bash_historybut the contents of this file may not always reflect the current history: