  
      // Check first for a stable tag
      final RegExp stableTagPattern = RegExp(r'^\d+\.\d+\.\d+$');
-@@ -760,7 +760,7 @@ class GitTagVersion {
+@@ -739,7 +739,7 @@ class GitTagVersion {
      // recent tag and number of commits past.
      return parse(
        _runGit(

   }
 
   /// Gets the release date of the latest available Flutter version.
@@ -730,7 +730,7 @@ class GitTagVersion {
 
   static GitTagVersion determine(ProcessUtils processUtils, {String? workingDirectory, bool fetchTags = false, String gitRef = 'HEAD'}) {
     if (fetchTags) {
-      final String channel = _runGit('git rev-parse --abbrev-ref HEAD', processUtils, workingDirectory);
+      final String channel = _runGit('git --git-dir .git rev-parse --abbrev-ref HEAD', processUtils, workingDirectory);
       if (channel == 'dev' || channel == 'beta' || channel == 'stable') {
         globals.printTrace('Skipping request to fetchTags - on well known channel $channel.');
       } else {
@@ -739,7 +739,7 @@ class GitTagVersion {
     }
     // find all tags attached to the given [gitRef]
     final List<String> tags = _runGit(

diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart
index 8e4cb81340..2c20940423 100644
--- a/dev/bots/prepare_package.dart
+++ b/dev/bots/prepare_package.dart
@@ -526,7 +526,7 @@ class ArchiveCreator {
 
   Future<String> _runGit(List<String> args, {Directory? workingDirectory}) {
     return _processRunner.runProcess(
