You can also just use 'fuck' for this:

  > git git pull
  git: 'git' is not a git command. See 'git --help'.

  The most similar command is
	init

  > fuck
  git pull [enter/↑/↓/ctrl+c]