code: def git_fetch(repo_dir, remote=None, refspec=None, verbose=False, tags=True):
      
      command = ['git', 'fetch']
      if not remote:
          command.append('--all')
      else:
          remote = pipes.quote(remote)
      command.extend(['--update-head-ok'])
      if tags:
          command.append('--tags')
      if verbose:
          command.append('--verbose')
      if remote:
          command.append(remote)
      if refspec:
          command.append(refspec)
      return execute_git_command(command, repo_dir=repo_dir)
docs: Do a git fetch of `refspec` in `repo_dir`.
  
      If 'remote' is None, all remotes will be fetched.