master/main change
master/main change
Posted Oct 21, 2025 15:40 UTC (Tue) by jhe (subscriber, #164815)Parent article: Git considers SHA-256, Rust, LLMs, and more
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] (2 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.
master/main change
master/main change
master/main change
main branches locally
main branches locally
main branches locally