Git 3.0 will be the first major Git version since Git 2.0 in 2014. It changes the default branch name and the hash behind every commit, and it removes some old commands. There's no release date yet, but recent Git versions already warn you about it.

Everything below comes from Git's official BreakingChanges document, and I ran the commands on Git 2.50 and 2.54.

Video version:

Your Git is already warning you

On Git 2.54:

$ git init hint: Using 'master' as the name for the initial branch. This default branch name hint: will change to "main" in Git 3.0. To configure the initial branch name hint: to use in all of your new repositories, which will suppress this warning, hint: call: ... $ git whatchanged 'git whatchanged' is nominated for removal. 

1. New repos start on main

"In new repositories, the default branch name will be main."

GitHub and GitLab already default to main, so Git itself is catching up. Existing repositories don't change, so your master branch stays master.

Where this bites you is scripts and CI that hard-code master:

# ❌ breaks on repos that start on main git checkout master && git pull # ✅ ask the remote for its default branch git symbolic-ref --short refs/remotes/origin/HEAD # origin/main 

To switch your new repos now (and silence the hint):

git config --global init.defaultBranch main 

2. SHA-1 → SHA-256 (for new repos)

"The default hash function for new repositories will be changed from 'sha1' to 'sha256'."

SHA-1 has known practical attacks (SHAttered in 2017, Shambles in 2020). You can try SHA-256 today:

$ git rev-parse HEAD # SHA-1: 40 characters f4eb4a3f7d40fece86f84c8daf8393ee8017f560 $ git init --object-format=sha256 $ git rev-parse HEAD # SHA-256: 64 characters c33c03f480171afd66ca23fe5968fee6c4fdcf1ac28283e927c3516a37f8a59d 

Don't panic:

  • It's only the default for new repositories.
  • "There is no plan to deprecate the 'sha1' object format at this point in time."
  • It waits on the ecosystem: forges, libraries and tools must support SHA-256 first. That's the main reason 3.0 has no date yet.

Action item: if your scripts, regexes or database columns assume commit hashes are exactly 40 characters, fix that.

3. reftable becomes the default ref storage

Branches and tags are currently stored as many small files (plus packed-refs). Git 3.0 switches new repos to reftable, which is faster with lots of refs. It also avoids collisions on case-insensitive filesystems (think Feature vs feature on macOS), and it makes multi-ref updates atomic.

You can use it today, even on an existing repo:

$ git init --ref-format=reftable $ git rev-parse --show-ref-format reftable $ git refs migrate --ref-format=reftable # convert an existing repo 

4. Commands and features being removed

Removed in 3.0 Use instead
git whatchanged git log --raw (add --no-merges for similar output)
git pack-redundant nothing; it's just removed (git gc handles pack cleanup)
git name-rev --stdin git name-rev --annotate-stdin
.git/info/grafts git replace

There are a few more on the official list: the branches/ and remotes/ shorthand directories, core.commentString=auto, and core.preferSymlinkRefs. Plus two non-removals worth knowing about:

  • safe.bareRepository defaults to explicit. Git will refuse to use a bare repo it only discovers by walking up directories.
  • git checkout is NOT being removed. It stays alongside git switch and git restore.

Do this now

  • [ ] git config --global init.defaultBranch main
  • [ ] Remove hard-coded master from scripts and CI
  • [ ] Don't assume 40-character commit hashes
  • [ ] Replace git whatchanged with git log --raw
  • [ ] Relax: existing repos keep working, and there's no release date yet

Are your repos still on master? 👇

I post one tested coding tip every day on YouTube at Refactorly. The 30-second version of this one is here.