Git 3.0: what is changing (main, SHA-256, reftable) and what to do now
Git 3.0 makes main the default branch, SHA-256 the default hash, and reftable the default ref store, and removes old commands. What changes, when, and what to check today.
Run git init on Git 2.56 without any settings, and the first thing you see is a warning:
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:
hint:
hint: git config --global init.defaultBranch <name>
That message is one small part of a bigger change. Git 3.0 is the first major Git version since Git 2.0 in May 2014. It changes three defaults that every new repository depends on, tightens one security setting, and removes a handful of old commands.
None of it will break your existing repositories overnight. But some of it will change what you see, and a few scripts and tools will need updates. This post explains each change in plain terms, shows what it looks like today, and ends with a short checklist.
Everything here comes from Git's official BreakingChanges document, which lists what the project has agreed to change. Every command and output in this post was run on Git 2.56.1, the newest release when this was written. Where something is a plan, a report, or an opinion rather than a decision, the post says so.
When is Git 3.0 coming?
The honest answer: there is no official date yet.
The BreakingChanges document says it directly: "There is no planned release date for this breaking version yet." It also says major versions come rarely. The last two were Git 1.6.0 (August 2008) and Git 2.0 (May 2014).
There is a reported plan, though. In September 2026, LWN wrote that Git maintainer Junio Hamano asked the community whether the next release should be 3.0. LWN later added an update from a conference talk by Git developer Patrick Steinhardt. It reported this plan:
- December 2026: a release called 2.98, to signal that 3.0 is coming.
- April 2027: 2.99, a long-term-support release, and Git 3.0 at the same time.
Treat that as a reported plan, not an announcement. As of 20 November 2026, the newest tag in Git's repository is v2.56.1. There is no 2.98 or 3.0 tag yet.
What is official is the support promise. BreakingChanges says the last version before 3.0 will be a long-term support release. It will get bug fixes for at least four release cycles, and security fixes for six. So if your company cannot move to 3.0 right away, there will be a supported 2.x to stay on.
The changes at a glance
| Change | Who it affects | Can you try it today? |
|---|---|---|
Default branch main (not master) | New repositories | Yes: git init -b main |
| Default hash SHA-256 (not SHA-1) | New repositories | Yes: git init --object-format=sha256 |
| Default ref storage reftable | New repositories | Yes: git init --ref-format=reftable |
safe.bareRepository = explicit | Tools that work inside bare repositories | Yes: set the config value |
| Old commands and settings removed | Scripts that still use them | Yes: they already warn or refuse |
| Rust required to build Git | People who build Git from source | Yes: Rust is on by default since 2.55 |
Notice the first column. Three of the six changes apply only to new repositories. Your existing repositories keep their branch names, their hashes, and their ref storage.
1. The default branch becomes main
What changes: when you run git init without saying which branch name to use, Git 3.0 names the first branch main instead of master.
Why: BreakingChanges says Git has warned about this since 2020, and that the new name "matches the default branch name used in new repositories by many of the big Git forges." If you create repositories on GitHub or GitLab, you are probably already used to main.
What it does not change: existing repositories. If your project's branch is called master, it stays master. Git 3.0 does not rename anything.
What to do now: choose a name once, and the warning goes away:
git config --global init.defaultBranch main
If you want to rename an existing branch, that is a separate decision with its own steps (local rename, remote update, and teammates updating their clones). The Renaming Branches lesson walks through it.
One thing to check: scripts that assume the first branch is master. A script that runs git init and then git push origin master will break when the branch is called main. Search your CI files and setup scripts for master.
2. New repositories use SHA-256
This is the biggest change, and the one people argue about most.
What a hash does in Git
Every commit, file, and folder in Git is stored as an object, and each object is named by a hash of its contents. That hash is the long ID you see in git log. If the content changes, the ID changes. The Object Model lesson shows this in a live repository.
Since 2005, Git has used SHA-1 for these IDs. SHA-1 IDs are 40 characters long.
Why Git is moving away from SHA-1
BreakingChanges gives the reasons. NIST deprecated SHA-1 in 2011. Then researchers showed real attacks: the SHAttered collision in 2017, and the SHA-1 is a Shambles attack in 2020. A collision means two different files with the same hash. For a system that trusts hashes to name content, that is a serious weakness, even if it is expensive to pull off.
Git has supported SHA-256 for a long time. GitHub's Git 2.45 highlights note that SHA-256 support arrived in Git 2.29 and stopped being experimental in Git 2.42. What changes in 3.0 is the default.
What it looks like
Here is a SHA-256 repository created on Git 2.56.1:
$ git init --object-format=sha256 -b main demo
$ cd demo
$ echo hi > f && git add f && git commit -m first
$ git log --format=%H -1
bbd7376cf06933ec596362ec43e9e86a166792fc64b09dbe5a03270a1a95650a
The ID is now 64 characters instead of 40. Short IDs like bbd7376 still work the same way.
You can ask any repository which hash it uses:
$ git rev-parse --show-object-format
sha256
What it does not change
BreakingChanges is clear: the new default is for "newly initialized repositories" only, and "there is no plan to deprecate the 'sha1' object format at this point in time." Your existing SHA-1 repositories keep working.
You also cannot switch an existing repository by accident. We tried:
$ git init --object-format=sha256 # inside an existing SHA-1 repo
fatal: attempt to reinitialize repository with different hash
The real catch: SHA-1 and SHA-256 repositories do not mix
A SHA-256 repository cannot push to a SHA-1 repository today. We tested it on Git 2.56.1:
$ git push ../sha1remote.git main
fatal: the receiving end does not support this repository's hash algorithm
Git has early, experimental work on making the two formats work together (Git 2.45 added "limited interoperability"), but it is not finished.
That matters for hosting. We could not find an official statement from GitHub or GitLab about hosting SHA-256 repositories. Scott Chacon, a GitHub co-founder, wrote in September 2026 that "you can't push this code to GitHub, though that will almost certainly be fixed by the time Git 3.0 is released." Until your host says it supports SHA-256, do not start a real project as a SHA-256 repository.
This is also why there is no date. BreakingChanges says the switch requires that "the ecosystem is ready to support the 'sha256' object format," naming Git libraries, applications, and forges.
3. New repositories store refs in reftable
What refs are: a ref is a name that points at a commit. Branches, tags, and remote-tracking branches are all refs. The Refs and Symbolic Refs lesson shows how they work.
How they are stored today: in the "files" format, each ref is a small file under .git/refs/, plus one shared packed-refs file. It is simple, but BreakingChanges lists real problems with it:
- On Windows and macOS, file names are not case-sensitive, so refs named
Featureandfeaturecan clash. - Deleting a ref can mean rewriting the whole
packed-refsfile, which is slow in repositories with many refs. - Updating several refs at once is not atomic. A crash can leave some updated and some not.
- Creating many refs at once is slow, and the format uses more disk space.
What reftable is: a binary format that stores refs in a few table files. It fixes the problems above. You can see the difference on disk:
$ git init --ref-format=reftable -b main demo2
$ ls demo2/.git/reftable
0x000000000001-0x000000000001-219222d0.ref
tables.list
For most people, nothing visible changes. git branch, git tag, and git log behave the same. The change matters to tools that read .git/refs/ files directly instead of asking Git. BreakingChanges names JGit, libgit2, and Gitoxide as libraries that need support. If you have a script that runs cat .git/refs/heads/main, switch it to git rev-parse main now. That works with both formats.
Try it on an existing repository: Git can convert refs in place:
git refs migrate --ref-format=reftable
Try that on a copy first, not on a repository your tools depend on.
4. Bare repositories need to be named explicitly
This change is about security, and it is easy to miss.
A bare repository is a repository with no working files, like the ones on a Git server. Today, if you cd into a folder that is a bare repository, Git finds it and works with it automatically.
The danger, as BreakingChanges explains: someone can hide a bare repository inside a normal project. If your shell prompt or editor runs git status when you enter that folder, Git can pick up the hidden repository, along with its config and hooks. That can run code you never chose to run.
Git 3.0 changes the default of safe.bareRepository from all to explicit. With explicit, Git only uses a bare repository when you name it directly. You can see the new behaviour today:
$ cd project.git
$ git -c safe.bareRepository=explicit rev-parse --git-dir
fatal: cannot use bare repository '.../project.git' (safe.bareRepository is 'explicit')
$ cd ..
$ git -c safe.bareRepository=explicit --git-dir=project.git rev-parse --git-dir
project.git
Who is affected: mostly people who run Git commands inside bare repositories, such as server scripts and some backup tools. The fix is to pass --git-dir=<path> or set GIT_DIR, both of which keep working. If you really need the old behaviour, BreakingChanges says you can set safe.bareRepository to all in your global or system config.
5. Old commands and settings are removed
Git 3.0 removes features that have had better replacements for years. Most of them already warn you, or refuse to run, on Git 2.56. Here is what goes, and what to use instead:
| Removed in 3.0 | Use instead |
|---|---|
git whatchanged | git log --raw --no-merges |
git pack-redundant | git repack -a -d, which removes redundant packs |
Grafts (.git/info/grafts) | git replace --graft |
git name-rev --stdin | git name-rev --annotate-stdin |
Remotes in .git/branches/ or .git/remotes/ | Remotes in config (git remote add) |
core.preferSymlinkRefs=true | Remove the setting |
core.commentString=auto | Set a specific comment character, or remove it |
If you still use git whatchanged, Git 2.56 already stops you and suggests the replacement itself:
'git whatchanged' will be removed soon.
hint: You can replace 'git whatchanged <opts>' with:
hint: git log <opts> --raw --no-merges
One command that is not going away: git checkout. Even though git switch and git restore now cover its two jobs, BreakingChanges says "all three commands will stay."
6. Rust becomes required to build Git
This one does not affect how you use Git. It affects people who build Git from source, mainly Linux distributions.
Parts of Git are being written in Rust. BreakingChanges lays out the steps: Rust became optional in Git 2.52, turned on by default in Git 2.55, and becomes required in Git 3.0. The project says it will check the impact on distributions first, and may delay this part if the impact is too large.
If you install Git with Homebrew, apt, winget, or an installer, you will not notice this change.
The disagreement about SHA-256
Not everyone thinks the SHA-256 default is a good idea, and it is fair to show both sides.
The Git project's view (from BreakingChanges): SHA-1 has known attacks, standards bodies have deprecated it, and it is better to be prepared than to switch in a hurry later. Existing repositories stay as they are.
Scott Chacon's view (his opinion post, September 2026): he argues the default change will be "an incomprehensibly expensive and ultimately valueless and avoidable global nightmare." His points:
- As far as he knows, an accidental SHA-1 collision has never happened in a Git repository, and attacks are "not really practical to exploit in any demonstrated way, but now theoretically possible."
- Moving to SHA-256 breaks every tool, link, and library that expects 40-character IDs, and "nearly none" of the libraries have full support.
- His alternative: "Don't use the hash to trust content." Instead, compute a separate SHA-256 checksum of the content and sign that, as the
git-evtagtool has done since 2015.
You do not need to pick a side to prepare. Both sides agree on the facts that matter for you today: existing repositories are not affected, and SHA-256 repositories cannot yet be used everywhere.
Common myths about Git 3.0
Myth 1: "Git 3.0 will convert my repositories." It will not. The hash, ref storage, and branch-name changes apply to newly created repositories. BreakingChanges has no plan to deprecate SHA-1. And as shown above, Git refuses to change the hash of an existing repository even if you ask with git init.
Myth 2: "Git 3.0 comes out in December." Officially, there is no date. The plan reported by LWN puts a release called 2.98 in December 2026 and Git 3.0 in April 2027, but the Git project has not published that in its documentation. Watch Git's release notes for the real announcement.
Myth 3: "I must rename master to main before upgrading." You do not. Git 3.0 only changes the name it picks for new repositories. A master branch keeps working exactly as before. Renaming is your team's choice, not something Git forces.
What to do now: a short checklist
You can do all of this today, on the Git you already have.
- Check your version: run
git --version. The warnings shown in this post appear on recent versions, so upgrading is the easiest way to see what 3.0 will change for you. - Pick a default branch name:
git config --global init.defaultBranch main(or whatever your team uses). This removes the warning and makes 3.0's change a non-event for you. - Search your scripts for
masterin setup code, forgit whatchanged, and for anything that reads files under.git/refs/directly. Replace them with the alternatives above. - Check bare-repository scripts: run them once with
git -c safe.bareRepository=explicitand fix any that fail by adding--git-dir. - Do not create real SHA-256 repositories yet. Try one in a test folder to see the 64-character IDs, but wait until your hosting service supports the format.
- Try reftable on a copy:
git refs migrate --ref-format=reftableon a test clone shows whether any of your tools read refs directly.
What to read next
- Git 2.56: git add --resolved, branch cleanup, and the features worth learning: the current release, and the one you need to see the warnings in this post.
- Git 2.55: the new features you will actually use: the release that turned Rust on by default, plus
git history fixup. - Git reflog: the undo button: how Git records every move of your refs, whichever format stores them.
To see hashes and refs for yourself, the Object Model lesson and the Refs and Symbolic Refs lesson let you inspect them in a live terminal.