Git considers SHA-256, Rust, LLMs, and more
Moving to SHA-256
Hashes are a core part of how Git works; they are used to identify commits, but also to identify the individual files ("blobs") managed in a Git repository. The security of the repository (and, specifically, the integrity of the chain of commits that leads to any given state of the repository) is no stronger than the security of the hash that is used. Git, since the beginning, has used the SHA-1 hash algorithm, which is increasingly viewed as being insecure. It has been understood for years that, sooner or later, Git will have to move to using a different hash algorithm.
So far, that move has been repeatedly pushed to the "later" column. That is not to say that no work has been done in that area; LWN first covered the effort to move to SHA-256 in 2020, with an update in 2022. Git has had the ability to manage a repository using SHA-256 hashes since the 2.29 release in 2020. That is only part of the job, though; before SHA-256 can be widely used, there needs to be a solution for interoperability between SHA-1 and SHA-256 repositories. Git is a distributed system, with hundreds or thousands of repositories existing even for relatively small projects. Converting all of those repositories to a new hash function simultaneously is simply not going to happen, so there must be a way to move commits between repositories using different hash functions.
Writing that sort of interoperability code is the kind of task that few developers are aching to take on. So it is not surprising that, in this case, few have. The task has fallen to brian m. carlson, who has done almost all of the SHA-256 work. This work is progressing slowly; a patch series focused mostly on documentation updates looks set to land in the next Git release. But, as carlson said recently, there is a lot still to be done if the planned 3.0 release is to switch to SHA-256 by default:
The SHA-256 interoperability work is not done yet. My estimate of this work is 200–400 patches, of which about 100 are done. If the original schedule is maintained, this would require writing up to 75 patches and sending in 100 patches per cycle, which is unrealistic without additional contributors.
He also pointed out that some of the Git-based forge systems are more advanced than others with regard to readiness for this change. The project as a whole seems undecided as to whether the completion of the interoperability code is a required feature for the 3.0 release or not. There is a desire, though, to set some sort of date for the SHA-256 switch, to put pressure on forges and such to be ready, if for no other reason.
Rust
When Linus Torvalds first wrote Git in 2005, he naturally wrote it in C, and that is still the language that the project uses. As is the case with many other C projects, though, there is an interest in moving to a safer language — Rust, in this case. Some Git developers are already working in Rust; notably, carlson is implementing some of the SHA-256 interoperability code in that language. There is also a reimplementation of the xdiff library in Rust by Ezekiel Newren that is making the rounds. Rust, it seems, is in Git's future.
The first step in that direction is likely to be this
patch series from Patrick Steinhardt, which introduces an optional Rust
module as a "trial balloon
" to help users and distributors adapt to
the new building requirements. The series includes a
documentation change indicating that Rust will become mandatory for
building Git as of the 3.0 release. This change seems likely to land in
a near-term Git release as well. Steinhardt has also been working on some
improvements to Git's continuous-integration infrastructure to enable
testing the Rust side of the build.
Large language models
Many projects have been struggling with whether (and how) to accept code that was produced with the help of large language models (LLMs); the Git project is no exception. Some projects are cautiously opening the door to such contributions; Git is being more cautious than most. Partly, that may be a result of its 2025 Google Summer of Code experience, where nearly all of the proposals received were LLM-generated; a first attempt at a related policy was considered at that time. Christian Couder recently posted an updated proposed policy for LLM-generated code that, in part, reads:
The Developer's Certificate of Origin requires contributors to certify that they know the origin of their contributions to the project and that they have the right to submit it under the project's license. It's not yet clear that this can be legally satisfied when submitting significant amount of content that has been generated by AI tools.Another issue with AI generated content is that AIs still often hallucinate or just produce bad code, commit messages, documentation or output, even when you point out their mistakes.
To avoid these issues, we will reject anything that looks AI generated, that sounds overly formal or bloated, that looks like AI slop, that looks good on the surface but makes no sense, or that senders don't understand or cannot explain.
There has been some discussion of this proposal, with carlson saying that it is not firm enough. Chuck Wolber worried that it reads like a total rejection of LLM-generated code, which he seemingly does not support. Elijah Newren said that he has already contributed some LLM-generated documentation and wondered if it needed to be reverted. Git maintainer Junio Hamano has posted a firmer variant of the proposed policy that is derived from the one used by the QEMU project. More discussion is to be expected, but it seems that the Git project will remain relatively unwelcoming to machine-generated contributions for the foreseeable future.
Other stuff
It will probably not be in the next release, but sometime thereafter Git will include some documentation of its data model contributed by Julia Evans. A change that more users may notice is using "main" as the default branch name, by Phillip Wood. There has been a desire to move away from "master" for some time; the change is likely to be made in the 3.0 release. The biggest concern about that change at this point, seemingly, is the existing body of Git tutorials using "master", which could prove especially confusing for just the sort of new users those tutorials are aimed at. To head off confusion, Git is likely to include one other change providing a hint for people who want to change the name back.
The Git project celebrated
its 20th anniversary this year; in those two decades, Git has become
one of the most important tools in a software developer's toolbox. After
all that time, it remains clear that the job is not yet done. Development
of Git is proceeding rapidly, and does not appear to be set to slow down
anytime soon.
Posted Oct 21, 2025 15:40 UTC (Tue)
by jhe (subscriber, #164815)
[Link] (28 responses)
Posted Oct 21, 2025 16:04 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link] (2 responses)
If you have more than one remote, you can (I think) write something like git switch -t origin/main. If you have local changes, you'll have to decide what to do with them, and there are flags for that (see git-switch(1)).
Posted Oct 21, 2025 16:24 UTC (Tue)
by jhe (subscriber, #164815)
[Link] (1 responses)
Posted Oct 21, 2025 17:11 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link]
Posted Oct 21, 2025 19:18 UTC (Tue)
by josh (subscriber, #17465)
[Link] (22 responses)
So, in a local repository, I always want every new branch to start from origin/main, not main, and I never want main to point to anywhere other than origin/main. And in a remote fork, main is nothing but a stale mirror of some ancient version of the base repo, because I never push to it except by mistake (creating a pull request from my main branch because I forgot to make a local branch, which is a pain).
The only time I ever want a local main branch is for the rare project where I commit directly to main, such as private one-person repositories.
Posted Oct 21, 2025 21:15 UTC (Tue)
by iabervon (subscriber, #722)
[Link]
Posted Oct 21, 2025 21:22 UTC (Tue)
by myUser (subscriber, #58242)
[Link]
Why then not just delete it? Yes it is created after cloning, but you can then just get rid of it for good.
Posted Oct 22, 2025 22:27 UTC (Wed)
by gioele (subscriber, #61675)
[Link] (19 responses)
I share your wish, but my concrete desire is that git would learn that "upstream repositories" are a special kind of repositories. Concretely, I'd like a simple way to tell git that:
1. Whenever I clone or fetch a certain remote (upstream), only a specific branch should be cloned/fetch (main). All other refs should be ignored.
2. A certain branch (main) should always be pulled from a certain remote (upstream) but always pushed to another one (myfork).
3. Even if I have r/w access to the upstream repository, it should never ever push any branch or tag to that repository.
Posted Oct 22, 2025 23:38 UTC (Wed)
by josh (subscriber, #17465)
[Link] (16 responses)
I wish the fork repository didn't have a main branch at *all*; I only want to push feature branches to my fork, not some stale main branch.
> 3. Even if I have r/w access to the upstream repository, it should never ever push any branch or tag to that repository.
Yeah, I'd like to have that as a local guard, though you can use server settings to block that so that *nobody* has push access.
Posted Oct 23, 2025 15:01 UTC (Thu)
by Wol (subscriber, #4433)
[Link] (14 responses)
So how would that work? You want your compile/build to crash every time upstream update main?
Your "stale main branch" is the old "head" at the time you made your fork. If you don't have that then either (a) you have no record that it IS a fork, and hence no way to contribute back, or (b) you have no record that it IS a fork, and hence no way to update your fork from the original project.
So once you fork, it's a new project with no way back? In which case, why not just update local main and that's an end to it?
Cheers,
Posted Oct 23, 2025 15:27 UTC (Thu)
by josh (subscriber, #17465)
[Link] (13 responses)
The fork would be a repository that has the metadata pointing to the upstream repo, and holds feature branches used for filing PRs, just as it is now; the only difference would be that it'd stop having a `main` branch that serves no function. main is not the metadata that points to the upstream repo.
> (b) you have no record that it IS a fork, and hence no way to update your fork from the original project.
My fork doesn't get "updated from the original project", it gets new feature branches pushed to it and used to submit PRs to the original project. Those feature branches are pushed from my local repository, which in turn has a remote for both the upstream origin and my fork. The workflow is "update origin, create new feature branch from origin/main, make commits, push feature branch to fork, create PR for fork, delete branch when PR is merged". At no point in that process is my fork's main branch useful in any way.
Posted Oct 23, 2025 17:59 UTC (Thu)
by Wol (subscriber, #4433)
[Link] (12 responses)
So you basically want to save about 20 bytes of on-disk space? And get rid of one line from the display of git branches?
> The workflow is "update origin, create new feature branch from origin/main, make commits, push feature branch to fork, create PR for fork, delete branch when PR is merged". At no point in that process is my fork's main branch useful in any way.
For which you need the main branch to exist. Otherwise, when upstream actions the pull request, how does it know what exactly to pull?
Bear in mind your repository is (unless you did a shallow clone) a copy of the *complete* repository with everything including everybody else's feature branches and everything (until they are pruned). So the cost of that tiny file saying "this is where remote origin/master/HEAD was when local origin was updated" is tiny. The cost of deleting the master branch depends on what you mean by "master branch". If you mean that file, your branch suddenly becomes the entire repository because you know longer have any way of knowing what exactly exists on your system and what exists upstream. If however you mean the entire master branch itself, you've just deleted most of your project, and it will no longer build because all of upstream code has disappeared ...
What problem do you *actually* have with the master branch, other than you think it's visual clutter? Whatever you call it, from the PoV of the project as a whole, a master branch is an absolute necessity.
Cheers,
Posted Oct 23, 2025 19:00 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link] (9 responses)
*My* pet peeve is using the upstream repository for any feature branches at all. Forges have finally gotten a clue and offered the "only copy the `HEAD` ref" trick, but I'd really rather *everyone* use their own fork for development (at least for projects with any kind of velocity…I have far more leeway for personal projects where cleanup was a feature branch or two a week). But fetching from GitLab's `origin` repository and having 100s of refs to update, prune, and manage is insane.
Posted Oct 23, 2025 19:06 UTC (Thu)
by josh (subscriber, #17465)
[Link] (4 responses)
But it *isn't* a baseline. Assuming I don't screw up and push to main by accident, all it does is provide a stale years-old snapshot of the upstream project's main branch (including its README), unrelated to any actual development going on in the repository.
> but having it not-exist introduces questions of what it means when your last feature branch is merged and you delete it. Is the `HEAD` ref resynced to keep the repository alive?
There's no fundamental reason a repository *couldn't* be kept alive with a virtual/fake/nonexistent HEAD. And to the extent forges don't support that, I'm frankly tempted sometimes to push a main branch containing a single empty commit, and make that HEAD. That's all independent of the metadata forges have showing what repository it was forked from.
Posted Oct 24, 2025 1:38 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link] (3 responses)
> Forges could have an option to sync it automatically (a button, automatic, or scheduled),
I agree that it is annoying that it is not (often) synchronized. I typically only do so to make it easier to batch-delete already-merged branches on the remote (`git branch -a --merged` exists, but it is useful to have the "how far ahead/behind" view).
> There's no fundamental reason a repository *couldn't* be kept alive with a virtual/fake/nonexistent HEAD.
I guess my question is: what happens when you fetch from your fork in this state?
Forges do store repositories in a single object space and namespaced refs. I wonder if a symref can point between namespaces so that your fork's main is just a symref to the origin's main.
Posted Oct 24, 2025 23:26 UTC (Fri)
by intgr (subscriber, #39733)
[Link] (2 responses)
But why spend the compute resources updating the branch if users don't need or use it? Even if it were periodically updated, that would just create the illusion of an up to date branch. When I rebase, I want the latest origin/main, not "a few hours out of sync" one.
I might only use the fork for one pull request and never thereafter. Why even waste the disk space if there are no remaining feature branches?
As for "baseline state" of the fork: that's just the common ancestor of upstream repo and any particular feature branch.
I had never thought about these things but everything that gioele and Josh here said is a revelation about why git and the forges based on it feel so clunky to interact with.
Posted Oct 25, 2025 2:01 UTC (Sat)
by mathstuf (subscriber, #69389)
[Link] (1 responses)
That's fine; why is your local `main` tracking your fork's `main` if you're not keep it up-to-date?
> I might only use the fork for one pull request and never thereafter. Why even waste the disk space if there are no remaining feature branches?
Forks live in the same repository as the main one. They are segregated using git namespaces (see `gitnamespaces(7)`) so that each access uses a different ref namespace and cannot "see" each other. This is the root cause of that issue where one could push a commit to a fork and then rewrite the URL to be that of the main repository and it would render your content under upstream's URL. I believe there is now a banner when this is done to show that the content is not actually "in" the repository being viewed when the object/tree/commit is not actually reachable from the project's ref namespace.
There was slight reference to this in it being "20 bytes on disk" elsewhere in this thread, but even that might be wrong (besides ref files being 40 bytes due to their ASCII representation) because I believe forges now use `reftable` to store refs in a single file (sqlite db?) rather than a file-per-ref due to filesystem overhead with that mechanism. The vast majority of the cost of a fork is in the database presence it takes up, not the git repository itself.
The shared-repository-with-namespaced-refs is also why I think some namespace-hopping symref to just make a fork's `main` *be* upstream's `main` would be an ideal solution here.
Posted Oct 25, 2025 3:03 UTC (Sat)
by josh (subscriber, #17465)
[Link]
14 years ago, a friend and I wrote the first version of the git namespaces support. :)
This is very much what I had in mind when saying that there's no fundamental reason a fork "needs" a main branch, or a distinct main branch, in order to be tied to the original repository.
> I had never thought about these things but everything that gioele and Josh here said is a revelation about why git and the forges based on it feel so clunky to interact with.
❤️
Posted Oct 23, 2025 21:00 UTC (Thu)
by gioele (subscriber, #61675)
[Link] (3 responses)
Some forges even have an "update fork" button/API as well as ways to periodically fetch updates the the HEAD-pointed branch.
I'd love if git-the-command-line-tool could also finally get a clue about this paradigm.
I'd like to be able to do something like `git clone $MYFORK-REPO-ON-A-FORGE --real-upstream $UPSTREAM-REPO` and have git taking care of:
1) correctly setting the remote from which branches should be pushed and pulled (`main` should be merged ff-only from $UPSTREAM-REPO, but pushed to $MYFORK-REPO-ON-A-FORGE),
I know that there are plenty of situations in which this kind of arrangement would not work, but it would cover the vast majority (95%+) of the projects and repos I deal with.
Posted Oct 24, 2025 1:44 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
If upstream ever rewrites history, the `ff-only` can leave you stranded. I prefer to just always trust what the remote repo is. Granted, actual rewriting should be for *extreme* cases (e.g., legal in nature or catastrophic like "oops, committed my VM disk"), but I see no reason to force ff-only here.
> 2) ignore all branches of $UPSTREAM-REPO not pointed by HEAD (so, only fetch `main`),
Some projects have support branches (`release` or the like). I also like to have these. It's the main reason I prefer upstream repos to only publish their maintained branches.
> 3) prevent direct pushes to $UPSTREAM-REPO (I may have admin access to that repo, but our workflow is PR-based),
Branch protection rules (i.e., server-side git hooks) should handle these situations. There's nothing to be done on the developer's side for these as I want the server to enforce them.
> I know that there are plenty of situations in which this kind of arrangement would not work, but it would cover the vast majority (95%+) of the projects and repos I deal with.
Yes, but when you bake in policy, all those corner cases become much sharper. Personally, I have a `git gh-add-fork` command that adds a fork on github to a repo I have with a structured name (`gh/$handle`) and, if it is my handle, sets it as the `remote.pushdefault` as well.
Posted Oct 24, 2025 10:00 UTC (Fri)
by gioele (subscriber, #61675)
[Link] (1 responses)
Agreed. What I meant was "ff-only" by default. If a pull cannot be fast-forwarded then I definitely want to know about it. I will mostly likely pass some option that says "it's OK, overwrite the branch instead of merging it", but I want to be in control of that.
> > 3) prevent direct pushes to $UPSTREAM-REPO (I may have admin access to that repo, but our workflow is PR-based),
As an admin I should have the ability to push whatever I want (or need) to any branch. But that's a big gun pointing at my foot, so I'd like my local tools to not allowing me to do that by default and then shout loudly when I ask them to do it nevertheless. Server-side hooks can be used to implements something similar, but IMO they should be used to solve problems like enforcing policy and access control, rather than as preventive measures for common mistakes.
Posted Oct 24, 2025 13:33 UTC (Fri)
by mathstuf (subscriber, #69389)
[Link]
Sure, the *ability* makes sense, but I'd rather have to go back to the forge, open the gate, do the action, then close the gate again. Having admin privileges just "laying around" is not a good idea (as you need to keep this in mind when onboarding new co-admins) and as an additional layer of defense in case your machine/key becomes compromised (not limited to rogue LLM-based agents "trying to help" or trying to cover their own mistakes).
I also can't say I've seen "common" mistakes which require rights to rewrite history (e.g., any token leak is not a reason as once it is leaked, it needs rotated anyways, so there's no reason to scrub it from history either). I acknowledge they can exist…but I'd also rather continue doing the "gate" thing to help try and train those making the mistakes to, maybe, not do that?
Posted Oct 23, 2025 19:16 UTC (Thu)
by josh (subscriber, #17465)
[Link] (1 responses)
I want to get rid of a years-out-of-date useless snapshot of the upstream repo, complete with rendered ancient README.
(That's leaving aside occasional annoying UI issues with local git when it starts thinking the local `main` branch should follow fork/main rather than origin/main.)
> For which you need the main branch to exist. Otherwise, when upstream actions the pull request, how does it know what exactly to pull?
That isn't how forges like github typically work. A pull request is sent from a feature branch to the upstream main branch, and the relevant thing is what changes are in that feature branch that aren't in *upstream's* main. The main branch of the fork plays no part in that whatsoever.
> Bear in mind your repository is [snip explanation of how git repositories and parent commits work]
I'm aware, and I'm certainly not suggesting all the parent commits should go away; that would not be compatible with how git works. I'm saying a fork that exists to host feature branches has no reason to have a main branch.
> If you mean that file, your branch suddenly becomes the entire repository because you know longer have any way of knowing what exactly exists on your system and what exists upstream.
The difference between my feature branch and upstream is represented via the changes present in `fork/myfeaturebranch` that aren't present in `origin/main`; that's what the PR will show as the commits it contains, and that's what upstream will end up reviewing. `fork/main` plays no part in that comparison, and is *always* useless noise (and useless noise that has a rendered stale README, etc).
Posted Oct 24, 2025 17:22 UTC (Fri)
by rfunk (subscriber, #4054)
[Link]
Posted Oct 25, 2025 23:32 UTC (Sat)
by marcH (subscriber, #57642)
[Link]
Agreed, that pointless copy/paste/diverge of origin/main is misleading and annoying.
But note Github was even worse a few years back when forking always duplicated _all_ origin branches! At least you can choose now to have only one stale duplicate. Significant progress.
Posted Oct 23, 2025 10:45 UTC (Thu)
by ewen (subscriber, #4772)
[Link] (1 responses)
“remote.pushDefault
(I mostly use it to pull from a public HTTP remote, without keys, but push to a SSH remote with keys. But AFAIK it should work for entirely different remotes.)
Ewen
Posted Oct 24, 2025 7:52 UTC (Fri)
by taladar (subscriber, #68407)
[Link]
Posted Oct 22, 2025 7:58 UTC (Wed)
by kleptog (subscriber, #1183)
[Link] (1 responses)
I'm actually surprised it hadn't changed in git already. GitLab/GitHub switched years ago so I thought it had been already done.
Posted Oct 22, 2025 9:04 UTC (Wed)
by jhe (subscriber, #164815)
[Link]
Posted Oct 21, 2025 15:42 UTC (Tue)
by adobriyan (subscriber, #30858)
[Link]
This is what is pulled into git's git. alias gitk='~/distfiles/git/gitk.git/gitk'.
Google told me that 2.42 should be OK except even 2.49 doesn't have latest gitk usable with SHA-256.
This is LLMs for you.
Posted Oct 21, 2025 23:23 UTC (Tue)
by newren (subscriber, #5160)
[Link] (4 responses)
> Git, since the beginning, has used the SHA-1 hash algorithm
Actually, it uses sha1dc (https://github.com/cr-marcstevens/sha1collisiondetection) by default since about Git 2.13 (2.40 if on mac). sha1dc returns the same thing as sha1 on most all inputs, but on inputs where sha1 has certain already-published weaknesses it yields a different result. That provides a little bit of extra protection, though the need to move on to a better hash still stands.
> Elijah Newren said that he has already contributed some LLM-generated documentation
I think that summary is prone to mislead or at least be misunderstood; perhaps if you said "LLM-edited" rather than "LLM-generated"? To me, the latter implies the LLM was generating lots of new prose, which it wasn't. I was feeding the LLM existing documentation and telling it look for typos, grammatical errors, and awkward wordings and provide suggested corrections. I then (heavily) filtered (and perhaps even further edited) the output, divided it up into logical commits, and submitted it all a few years ago, and was fully up-front about what I was doing at the time. I think that's a good use of an LLM that an open source project shouldn't ban (and suggested a couple others), but it looks like I might lose on that point.
Posted Oct 22, 2025 3:10 UTC (Wed)
by bronson (subscriber, #4806)
[Link] (1 responses)
If you wrote understood everything, and the LLM made some occasional minor fixes, then there's little chance of it being able to generate infringing content. IIUC.
Posted Oct 22, 2025 15:47 UTC (Wed)
by newren (subscriber, #5160)
[Link]
> This policy does not apply to other uses of AI, such as researching APIs or algorithms, static analysis, or debugging, provided their output is not to be included in contributions.
To me, the wording of that exception does not include my case because I didn't just have it notify me of problematic text that I then went and manually fixed up myself, I had it suggest corrected text and then I looked at the diffs and picked the pieces that I liked and split it up into different commits (and possibly modified further). So the whole "provided their output is not to be included in contributions" rules that out.
Also, note that I was feeding all the git manpages to the LLM, one at a time, so it is not just my documentation I was having it edit. Those manpages are the combined work of many people over a long time. It is true that the LLM only suggested minor occasional fixes to the manpages, and I don't think that would be enough to trigger any problems, but to me the latest proposal is extra strict and conservative and rules out usecases like, which I think would be regrettable.
Posted Oct 22, 2025 3:30 UTC (Wed)
by WolfWings (subscriber, #56790)
[Link] (1 responses)
A bunch of artists I know re-drew those portions and/or just removed those pieces from their online gallery years later as it turned out how bad LLMs were for creatives as a whole.
In this case though what's the difference/improvement between what you did and just running the same documentation through hunspell for example?
Posted Oct 22, 2025 15:56 UTC (Wed)
by newren (subscriber, #5160)
[Link]
Logically, I was using the LLM kind of like a glorified spell checker, so that is very good comparison. It's certainly very similar, and I've run the git documentation through command line spell checkers before. However, I found that spell checkers tend to turn up far more false-positives than an LLM does, making it much more labor intensive (and meaning that I got through a smaller subset of the Documentation and didn't repeat the exercise again later). Further, spell checkers (at least whatever one I used -- aspell? It's been long enough that I don't recall which one I ended up using) only tend to catch typos and spelling errors, while missing grammatical errors and awkward wordings/phrasings. LLMs catch and fix a wider variety of problems while having fewer false positives. (Though there were still quite a few, mostly because it was attempting to standardize American vs. British English spellings, and the manpages were so inconsistent on that point that I didn't want to subject the list to the noise of standardizing all of those.)
Posted Oct 22, 2025 11:42 UTC (Wed)
by Lennie (subscriber, #49641)
[Link] (1 responses)
So it's going to cause problems if git switches to it by default.
Gitlab supports it, forgejo, codeberg and gitea seem to support it at first glance.
Ohh, I found Bitbucket also seems to have ignored it.
Posted Oct 22, 2025 11:43 UTC (Wed)
by Lennie (subscriber, #49641)
[Link]
Posted Nov 3, 2025 15:01 UTC (Mon)
by zahlman (guest, #175387)
[Link] (3 responses)
But making a change like this still concerns me for more meta-level reasons. It seems clear that it's a *response* to trends in how people are using Git, rather than something that the developers independently decided would improve the software. It's been about five years since GitHub's initial experiment, and presumably they were not the first to come up with the idea.
And it equally seems clear that the choice to rename the branch from "master" to "main" has been a social signal. All the historical evidence I can find of projects and companies documenting the change presents it as a moral imperative — insisting that it's what everyone should do in order to create a more "inclusive atmosphere", or "community", etc. To my mind, the argument has all the markings of a classic "holy war" (albeit a fairly one-sided one). But on a purely technical level, the change is so trivial that I can only assume that advocates are actually sincere in their belief that a social problem is solved this way.
The problem I have here is that these arguments never actually lay out any *reasoning* that I can comprehend. Those who object are at most hand-waved away by pointing at the history of slavery in the USA (or perhaps mocked or derided for supposedly not knowing about this, or supposedly ignoring it). But putting aside the Americentrism, and putting aside that the word "master" has many other uses (and in particular, there's no meaningful sense in which the *other* branches of a Git repository could be called "slaves"), there's no explanation offered whatsoever of why a *mere reference* to atrocities of the past should be problematic (much less for one specific group of people, descended from the victims of one particular implementation of that atrocity).
After all, when the topic is discussed, nobody sees fit to *censor* the word "master", or "slave" for that matter. (Unlike some other words relevant to the discussion of American racial politics, which are so charged that nobody even cares about use-mention distinction in practice.) So if that's the standard for discussions that are nominally about making people from racial minorities feel comfortable — discussions that nominally are supposed to center the views of those racial minorities — then I can only logically conclude that simply seeing the word "master" in the output of a Git command is not actually traumatic to anyone.
So can someone please explain to me: what, concretely, is the supposed reasoning by which it would cause anyone harm, or inhibit "diversity" goals, to leave the existing default intact — or for that matter, for GitHub and all those other projects to have skipped making such a change?
Posted Nov 4, 2025 9:26 UTC (Tue)
by kleptog (subscriber, #1183)
[Link] (1 responses)
In my opinion, "main" is just an objectively better name. It means what it says, whereas "master" is jargon you have to learn. Which makes a small difference to be sure, but the cost is marginal.
That doesn't cover why people change existing repo's though. Though I can imagine external tooling cares. For some new repo's I actually force a master branch because it's easier if all the repo's in a certain group all use the same branch name.
Posted Nov 4, 2025 13:22 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link]
"All" drinks in the US are kosher due to this. You have the vast majority of the population that couldn't care less and a small, but non-negligible, portion that *really* cares. To avoid the problem, you just make it all acceptable to the discerning group (if the cost is low enough[1]).
> That doesn't cover why people change existing repo's though. Though I can imagine external tooling cares. For some new repo's I actually force a master branch because it's easier if all the repo's in a certain group all use the same branch name.
Yes. We have not changed our historical repos (30+ years; 15+ as Git), but new ones are a mix.
[1] Vegetarian options, while also enabling a similar scale of population to eat at an establishment, is *not* cheap and depends much more on local populations.
Posted Nov 4, 2025 9:39 UTC (Tue)
by taladar (subscriber, #68407)
[Link]
master/main change
master/main change
master/main change
master/main change
main branches locally
main branches locally
main branches locally
main branches locally
>
> So, in a local repository, I always want every new branch to start from origin/main, not main, and I never want main to point to anywhere other than origin/main. And in a remote fork, main is nothing but a stale mirror of some ancient version of the base repo, because I never push to it except by mistake (creating a pull request from my main branch because I forgot to make a local branch, which is a pain).
main branches locally
main branches locally
Wol
main branches locally
main branches locally
Wol
main branches locally
main branches locally
main branches locally
main branches locally
main branches locally
main branches locally
main branches locally
2) ignore all branches of $UPSTREAM-REPO not pointed by HEAD (so, only fetch `main`),
3) prevent direct pushes to $UPSTREAM-REPO (I may have admin access to that repo, but our workflow is PR-based),
4) block commits to the `main` branch (all development should happen in feature branches).
main branches locally
> 4) block commits to the `main` branch (all development should happen in feature branches).
main branches locally
>
> If upstream ever rewrites history, the `ff-only` can leave you stranded. I prefer to just always trust what the remote repo is.
> > 4) block commits to the `main` branch (all development should happen in feature branches).
>
> Branch protection rules (i.e., server-side git hooks) should handle these situations. There's nothing to be done on the developer's side for these as I want the server to enforce them.
main branches locally
main branches locally
main branches locally
main branches locally
main branches locally
The remote to push to by default. Overrides branch.<name>.remote for all branches, and is overridden by branch.<name>.pushRemote for specific branches.”
main branches locally
master/main change
master/main change
gitk
A couple small clarifications
If the LLM merely fixed up your writing, then you should be in the clear?
Junio's proposed guidelines allow for AI tool use, as long as the output is considered tainted:
A couple small clarifications
This policy does not apply to other uses of AI, such as researching APIs or
algorithms, static analysis, or debugging, provided their output is not to be
included in contributions.
(That makes sense because useful LLMs are pretty much all trained on incompatible data. The entire industry has rampant piracy at its foundation.)
A couple small clarifications
A couple small clarifications
A couple small clarifications
Pretty certain biggest delay in SHA256 adoption is Github
Pretty certain biggest delay in SHA256 adoption is Github
Understanding the branch renaming
Understanding the branch renaming
Understanding the branch renaming
Understanding the branch renaming
