Quick article on how to search the OSX terminal history
r to start the history search and start typing your search term (in my example
(reverse-i-search)`git': git push origin develop
(reverse-i-search)indicates that the search mode is activated
gitis the search term
git push origin developis the result
If the first result is not the one you are looking for, continuously press
Enter to execute the command
right arrow to insert the command in the current line
In some cases, you might want to display an history of commands containing your search term
You can do this with the following command
$ history | grep 'git'
Will display of all the previous commands that contain
history command displays the full history of executed commands. In this example, we are piping the result into a grep command in order to filter the results we want.