code: def git_clone(git_url, path):
      
      if os.path.exists(os.path.join(path, '.git')):
          # get rid of local repo if it already exists
          shutil.rmtree(path)
  
      os.makedirs(path, exist_ok=True)
      print('Start cloning from {}…'.format(git_url))
      git_proc = subprocess.Popen(['git', 'clone', git_url, path],
                                  stderr=subprocess.PIPE,
                                  stdout=subprocess.PIPE,
                                  env={'GIT_TERMINAL_PROMPT': '0'})
  
      try:
          stdoutmsg, stderrmsg = git_proc.communicate(timeout=120)
      except subprocess.TimeoutExpired:
          git_proc.kill()
          stderrmsg = b'Timed out.'
  
      if git_proc.returncode == 0:
          print('Cloned {}.'.format(git_url))
      else:
          print('Error cloning from {}:\n{}'.format(git_url,
                                                    stderrmsg.decode('utf-8')))
docs: Clone git repository at $git_url to $path.