Coder Social home page Coder Social logo

Hello, GitHub users.

GitHub, and its parent company, Microsoft, continue their work with ICE.

As a community, we should be using other alternatives. I don't host any of my work here.

(It's also weirdly disapointing how centralized the ecosystem around a distributed version control system has become.)

Sourcehut is a good alternative which, in addition to not facilitiating ICE's work, is more flexible in its services and resists excess centralization.

Rename your default branch in git.

The default branch name in git, at least as of 2020, is both confusing, obscuring some of git's properties, and has some racist baggage behind it. We should use a different name, and git should change the default. To their credit, github has fixed the default branch, but git hasn't (yet?), and you can still get a nasty default if importing from elsewhere. Until git fixes this, you can correct things locally.

Rename the default branch on a local repository:

This part is trivial:

git branch -m master main

The fact that it's that simple surprises a lot of people (including me, initially), because part of the problem is the existing default name hides the fact that there's nothing special about it.

Push the new name to any remote/upstream repositories.

If you have remote/upstream repositories, push the new branch out there:

git push -u origin main

...or whatever your remote repo is, if other than "origin". You can get a list of your configured upstream repo names with:

git remote -v

If GitHub is one of your remotes (you are here, after all), you'll probably want to go to the repository's settings and change the default there. Once you do this, you'll have both the new and old names in your remote repo. To delete the old name from your remote repo, so this:

git push origin --delete master

Tell git to use better names by default.

To make git init create a repo with a better name by default, add these lines to $HOME/.gitconfig or $HOME/.config/git/config:

[init]
	templateDir = ~/.config/git/template/

Then make the template dir with a single line for

mkdir -p $HOME/.config/git/template
echo 'ref: refs/heads/main' > $HOME/.config/git/template/HEAD

There's a bit more discussion where I got the steps from and this linked Stack Overflow note on changing the default branch name.

Side note: branch names can be unicode. For example, git branch -m master 🌱 works fine. :-)

Find me elsewhere.

You can find me online at a.9srv.net, in the Fediverse🐘 as [email protected], or in the physical world🗺, usually in Columbia County, Oregon.

Anthony Sorace's Projects

conterm icon conterm

Drawterm without graphical user interface.

we-are-twtxt icon we-are-twtxt

Voluntary registry of Twtxt users and automated feeds (bots). This registry is user contributed. If you want to list/publish your Twtxt feed, submit a PR!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.