git-flutter CLI

The Git Flutter CLI is a comamnd line tool to save you time when using standard source setups.

This public content is an excerpt from Flutter staff GitHub docs. It is published as a reference to show how GitHub is used for inner source at Flutter.
$ git flutter 
Work with Flutter-Global from the command line.

Usage:
  git flutter [command]

Available Commands:
  feature     Create a feature branch for your work.
  help        Help about any command
  hotfix      Create a hotfix branch for your work.
  push        Push the current branch to remote origin.
  release     Start or cancel a release
  status      Displays the status of the current repo
  sync        Merges any outstanding changes into the current branch.
  tag         Tag the current branch with a semantic version.

Flags:
  -h, --help         help for git flutter
      --no-network   do not perform network operations
  -v, --verbose      verbose log output
      --version      version for git flutter

Use "git flutter [command] --help" for more information about a command.

MacOS or Linux

To install on macOS or Linux:

  1. Run the installation script:
 curl -o- https://innersource.flutter.com/git-flutter/install.sh | bash
  1. Close and reopen your terminal to start using git flutter or run the following command to use it immediately:
 [ -d "$HOME/.git-flutter/bin" ] && PATH="$HOME/.git-flutter/bin:$PATH"
  1. Verify the extension installation via git:
 git flutter --version

Windows

To install on a Windows machine:

  1. Download the latest release v2.1.2.

Or if you have curl installed, use this command:

curl https://innersource.flutter.com/git-flutter/git-flutter_2.1.2_Windows_x86_64.zip
  1. (Optional) Validate the binary by comparing the provided checksum with that of the download which you can calculate at the command prompt:
CertUtil -hashfile git-flutter_2.1.2_Windows_x86_64.zip SHA256
  1. Extract the git-flutter_2.1.2_Windows_x86_64.zip file and copy the git-flutter.exe into C:\Program Files\Git\usr\bin.

  2. Verify the extension installation via git:

git flutter --version

Getting Started

Your usage of this tool depends on your choice of branching strategy – but it’s particularly recommended to reduce mistakes in complex branching models like multiple teams source. Read the CLI getting started guide for multiple team source here.

Configuration

You can configure the CLI using git config locally for a specific checkout, or globally for all checkouts.

Fetch Frequency

The CLI model never goes to the actual origin but uses the view of the origin the local checkout has. This needs updating regularly from the remote origin by git fetch, but this is slow (~1-2s).

There are 3 behaviours supported, configured via git config key flutter.fetch:

  • never : never fetch from remote origin
  • always : always fetch from remote origin
  • auto : (default) periodically fetch from remote origin

To setup the fetch behaviour, run the following command:

git config --global flutter.fetch <never|always|auto>

Telemetry

We use OpenTelemetry to collect usage data and send it to our telemetry server. This helps us understand how you use the CLI so we can improve it for you.

We collect the following data:

  • the command you ran
  • the version of the CLI
  • operating system & system architecture of your machine
  • command run times
  • any errors thar occur

We don’t collect any personal data.

You can configure this via git config key flutter.analytics:

  • never : never report analytics or update latest version
  • always : always report analytics or update latest version

The default behaviour uses a timestamp in this config key to ensure the remote config is only fetched every 24hrs. You can also run git flutter analytics to update the timestamp value for the current day and force an update verification.

  • <timestamp> : periodically report analytics or update latest version, with this Unix timestamp being the last fetch time of the remote config.
git config --global flutter.analytics <never|always|timestamp>

Support

The Inner Source Team support this CLI. Direct contributions are welcome via the fsc-git-flutter repository.