code: def determine_git_ref(self, config):
          
          # First ensure redundant config keys aren't specified (which could
          # cause confusion as to which take precedence)
          ref_config_keys = 0
          for i in ['commit', 'tag', 'branch']:
              if config.get(i):
                  ref_config_keys += 1
          if ref_config_keys > 1:
              raise ImportError("Fetching remote git sources failed: "
                                "conflicting revisions (e.g. 'commit', 'tag', "
                                "'branch') specified for a package source")
  
          # Now check for a specific point in time referenced and return it if
          # present
          if config.get('commit'):
              ref = config['commit']
          elif config.get('tag'):
              ref = config['tag']
          else:
              # Since a specific commit/tag point in time has not been specified,
              # check the remote repo for the commit id to use
              ref = self.git_ls_remote(
                  config['uri'],
                  self.determine_git_ls_remote_ref(config)
              )
          if sys.version_info[0] > 2 and isinstance(ref, bytes):
              return ref.decode()
          return ref
docs: Determine the ref to be used for 'git checkout'.
  
          Args:
              config (dict): git config dictionary
  
          Returns:
              str: A commit id or tag name