code: def git_clone(target_dir, repo_location, branch_or_tag=None, verbose=True):
      
      target_dir = pipes.quote(target_dir)
      command = ['git', 'clone']
      if verbose:
          command.append('--verbose')
      if os.path.isdir(repo_location):
          command.append('--no-hardlinks')
      command.extend([pipes.quote(repo_location), target_dir])
      if branch_or_tag:
          command.extend(['--branch', branch_or_tag])
      return execute_git_command(command)
docs: Clone repo at repo_location to target_dir and checkout branch_or_tag.
  
      If branch_or_tag is not specified, the HEAD of the primary
      branch of the cloned repo is checked out.