This is part of a journey to build and publish a Flutter based app for the App Store and Google Play — updated for 2026 with current tooling, workflows, and platform guidance.
At some point in any serious project, source code control stops being optional. If you're working across more than one machine — or simply want a safety net — Git is the answer.
TL:DR – This article covers Git setup and daily use across macOS and Chrome OS in 2026, including what's changed with authentication, tooling, and the Chrome OS Linux environment.
Contents
- Why Git, and why now?
- What's changed in 2026
- What is Source Code Control?
- Git: a quick overview
- Setting up Git on macOS
- Initialising and pushing your first repository
- Authentication: SSH keys and the GitHub CLI
- Setting up Git on a Chromebook
- Daily Git workflow
- Advanced techniques: rebasing, merging, and conflict resolution
- Cross-platform consistency: line endings, permissions, and configuration
- Hosting, CI/CD, and security
- Troubleshooting common issues
- Conclusion and next steps
Why Git, and why now?
I've been building this Flutter project primarily on my Mac, but the moment I wanted to pick it up on a Chromebook or a ThinkPad running Ubuntu, I needed a proper version control strategy. Git is the clear default choice — it underpins virtually every tool in the modern development stack, from Android Studio to GitHub Actions. The learning curve is real but manageable, and the graphical tooling has improved enormously. Let's get into it.
My setup is straightforward: three machines — a Mac, a Chromebook, and a ThinkPad running Ubuntu — and I want the Flutter source code in sync and runnable via Android Studio or the command line on all of them. Git handles this easily, and scales to full team collaboration when you need it.
What's changed in 2026
A few things have shifted since this article was first written, and they're worth calling out upfront so you don't waste time following outdated instructions.
First, Chrome OS Linux support is now standard. Every Chrome OS device released from 2020 onwards ships with a built-in Linux development environment. You no longer need to jump through hoops or hunt for workarounds — it's a first-class feature. To enable it, open the Launcher, search for Linux, and click Turn on. If you're on an older device that predates this, Termux is available from the Google Play Store as a capable terminal emulator, and Git installs there with a single command: pkg install git.
Second, authentication has changed significantly. GitHub removed support for password-based Git operations some time ago, and the ecosystem has largely settled on two approaches: SSH keys, or HTTPS with the GitHub CLI. The CLI route — running gh auth login — is now the recommended path for most users. It walks you through authenticating via either HTTPS or SSH, handles credential caching automatically, and removes most of the friction that used to trip people up. If you prefer SSH keys directly, that still works perfectly well and is covered below.
Third, the default branch name has shifted from master to main across GitHub, GitLab, and most other providers. If you're initialising a new repository, use main from the start to stay consistent with remote defaults.
What is Source Code Control?
Source code control — sometimes called version control — is a system for managing and tracking changes to a codebase over time. It captures every modification as a snapshot, giving you a complete chronological history. That means you can review what changed and when, revert to a previous state if something breaks, and pinpoint exactly where a bug was introduced.
Beyond versioning, it's the foundation of collaboration. Multiple developers can work on the same files simultaneously, on different machines and operating systems, with changes reconciled automatically wherever possible. It also acts as a safety net against accidental data loss. In short: if you're writing code that matters, you should be using version control.
For solo developers working across multiple devices — which is exactly my situation — the benefits are just as real. Git keeps everything in sync, gives you a clean history of your own decisions, and makes it trivial to experiment in a branch without risking your working code.
Git: a quick overview
Git is a distributed version control system, which means every developer (or device) holds a complete copy of the repository, including its full history. There's no single server you depend on to do your work — you commit locally, then push when you're ready. This makes it fast, resilient, and well-suited to working offline.
Its branching model is one of its greatest strengths. Branches let you work on a new feature or experiment in complete isolation from your stable code. When you're happy, you merge it back. Tags let you mark specific points in history — typically releases — as permanent, named references.
Git's main competition historically came from Subversion (SVN), which uses a centralised model, and Mercurial, another distributed system with a gentler learning curve. Neither has kept pace with Git's ecosystem, tooling, or community. For Flutter development in 2026, Git is simply the assumed default.
Setting up Git on macOS
The easiest way to install Git on macOS is via Homebrew. Open Terminal and run:
brew install git
Once installed, confirm it worked with git --version, and check the active path with which git to make sure you're running the Homebrew version rather than the older system Git that macOS bundles. Then set up your identity — this information is attached to every commit you make:
git config --global user.name "Your Name"
git config --global user.email "This email address is being protected from spambots. You need JavaScript enabled to view it. "
If you use BBEdit as your editor, you can set it as the default for commit messages with:
git config --global core.editor "bbedit --wait --resume"
It's also worth setting your default branch name to main to match what GitHub and other providers now use:
git config --global init.defaultBranch main
If you work with multiple Git providers or need separate SSH keys per service, the article Connecting to multiple Git repository providers with SSH covers that setup in detail.
Initialising and pushing your first repository
Once Git is configured, getting your project into version control takes just a few commands. Navigate to your project directory and run:
git init
git add -A
git commit -m "First commit"
git remote add origin your.reponame.git
git push -u origin main
Note the use of main rather than master in that final push — this matches the default branch name on GitHub and GitLab. If your remote was created with main as the default, this will work cleanly. If you hit a mismatch, git branch -M main renames your local branch before pushing.
To bring an existing repository down to a new machine, use:
git clone <repository-url>
This copies the full project history locally and sets up the remote tracking automatically.
Authentication: SSH keys and the GitHub CLI
Password authentication for Git over HTTPS was deprecated and removed by the major providers. In 2026 you have two solid options.
Option 1 — GitHub CLI (recommended for most users): Install the CLI with brew install gh on macOS, or via your Linux package manager on Chrome OS. Then run gh auth login and follow the prompts. It handles HTTPS credential caching automatically and is the path GitHub itself now recommends.
Option 2 — SSH keys: Generate a key pair with ssh-keygen -t ed25519 -C "
Either approach works on both macOS and Chrome OS's Linux environment with identical commands.
Setting up Git on a Chromebook

On any Chrome OS device from 2020 onwards, enabling Linux is a matter of opening the Launcher, searching for Linux, and clicking Turn on. Chrome OS will download and configure a Debian-based Linux container. Once that's done, open the Linux terminal and install Git with:
sudo apt-get update && sudo apt-get install git
Configuration from there is identical to any other Linux or macOS setup — the same git config commands, the same SSH key generation, the same gh auth login flow if you prefer the CLI route.
For older devices that don't support the Linux environment, Termux from the Google Play Store provides a terminal emulator where Git installs with pkg install git. It's a lighter-weight option but perfectly functional for pulling, committing, and pushing.
The full Flutter development environment setup for Chromebook is covered in the companion article: Flutter development on a Chromebook.
Daily Git workflow
Once everything is configured, your day-to-day Git usage comes down to a small set of commands used repeatedly. git status shows what's changed and what's staged. git add stages specific files or all changes. git commit records a snapshot with a message. git push uploads your commits to the remote. git pull fetches and integrates the latest changes from the remote into your current branch.
Branches are where Git earns its reputation. Use git checkout -b feature/my-new-thing to create and switch to a new branch, work freely, then merge back with git merge or open a pull request on GitHub. This keeps your main branch stable while you experiment.
Two other commands worth keeping in your toolkit: git stash temporarily shelves uncommitted changes so you can switch context without losing work, and git cherry-pick <commit-hash> lets you apply a specific commit from one branch to another without merging the whole thing.
Advanced techniques: rebasing, merging, and conflict resolution
Merging and rebasing are both ways to integrate changes from one branch into another, but they produce different histories. A merge preserves the full branch structure — useful for transparency in team projects. A rebase replays your commits on top of another branch, producing a cleaner linear history. Both have their place; the important thing is to avoid rebasing commits that have already been pushed and shared with others, as it rewrites history in a way that causes problems for anyone else working from those commits.
Merge conflicts happen when two branches change the same part of a file differently. Git marks the conflicting sections clearly in the file, and you resolve them by editing manually, then staging and committing the result. Tools like GitLens in VS Code, or the built-in diff viewer in Android Studio, make this significantly less painful than editing raw conflict markers.
Cross-platform consistency: line endings, permissions, and configuration
Working across macOS and Chrome OS (Linux) is generally smooth because both are Unix-based — line endings are consistent, and file permissions behave predictably. The main friction point arises if Windows ever enters the picture, since Windows uses different line endings. Git's core.autocrlf setting handles this automatically, but it's worth being aware of if your team is mixed.
To keep your Git configuration consistent across machines, consider storing your .gitconfig in a dotfiles repository. This makes it trivial to replicate your setup on a new device — clone the repo, run a setup script, and you're working in a familiar environment within minutes.
Hosting, CI/CD, and security
GitHub remains the dominant platform for hosting repositories, with GitLab and Bitbucket as solid alternatives. Assembla continues to serve teams that want private repositories with project management built in. All of them support the same core Git protocols, so switching between them doesn't require changing your local workflow.
CI/CD pipelines — automated testing and deployment triggered by Git events — are now a standard part of serious Flutter projects. GitHub Actions is tightly integrated with GitHub repositories and requires minimal configuration to run Flutter tests on every push. GitLab CI offers similar capability. Setting these up early pays dividends quickly.
On security: use SSH keys or the GitHub CLI for authentication rather than storing passwords. Enable two-factor authentication on your Git provider account. Keep repositories private until you're ready to share them. These are basic hygiene steps that take minutes to set up and meaningfully reduce your exposure.
Troubleshooting common issues
Authentication errors are the most common stumbling block for new setups. If you're using SSH, verify your key is added to your provider's account settings and that your local SSH agent is running (ssh-add ~/.ssh/id_ed25519). If you're using the GitHub CLI, re-running gh auth login usually resolves stale credential issues.
File permission problems occasionally surface on Chrome OS when scripts need to be executable. The chmod +x filename command resolves this. On macOS, the same applies.
For diagnosing repository health, git fsck checks integrity, git bisect helps isolate which commit introduced a bug, and git blame shows the last author to touch each line of a file. GitLens in VS Code surfaces all of this visually, which is often faster than the command line for exploratory debugging.
Conclusion and next steps
Git is non-negotiable for any serious development project, and in 2026 the setup experience is genuinely better than it used to be — particularly on Chrome OS, where Linux support is now built in and polished. The authentication story has also simplified: the GitHub CLI removes most of the credential friction that used to catch people out.
The fundamentals haven't changed: init, add, commit, push, pull, branch, merge. Master those and you're productive. The advanced features — rebasing, cherry-picking, stashing, CI/CD integration — are there when you need them, and the tooling around Git has never been better for making them accessible.
For further reading, Pro Git by Scott Chacon and Ben Straub remains the definitive reference and is available free at git-scm.com/book. The official GitHub documentation at docs.github.com is also well-maintained and covers platform-specific setup in detail.