Rename a Git Branch

preview_player
Показать описание
Here's a full tutorial on how to do a Git branch rename that I wrote over on TheServerSide:

Or you can read this...

It's fairly each to change a Git branch name. In fact, one common need is for organizations to change the master branch to main. If you need to rename Git's master branch to main, it's easy:

git branch -M master main

Changing the term "master" to "main" is a part of a larger movement within the tech industry to replace potentially racially-charged or exclusionary language with more inclusive alternatives. The term "master" in the context of version control systems like Git has historically been used to refer to the main branch of a repository, from which other branches are derived. However, some people have pointed out that the term "master" can carry connotations of slavery and oppression, and may be considered offensive or exclusionary to some individuals.

As a result, many projects and organizations have chosen to rename the default branch from "master" to "main" as a way to promote inclusivity and diversity in their communities. This change involves updating documentation, configuration files, and other references to reflect the new branch name.

The switch from "master" to "main" is part of a broader effort to create more welcoming and inclusive environments within the tech industry and beyond.

Full article here:

Рекомендации по теме