The main argument for changing "master" to "main" is to reduce the occurrences of problematic terminology in a team's codebase. Many names have been suggested, like "primary" and "default", but "main" has so far emerged as the most popular alternative. In the vein of making technology a more inclusive place, one initiative has been to rename the master branch to a different name. The name "master" is significant because it has been both the standard name for the default git development branch but also carries clear references to slavery (e.g. The current discussion has been around naming terminology in software development and how to make it more inclusive to the Black community. This move is one that we've adopted at Kapwing, and in this article, we'll discuss some of the thinking that went into this change as well as a short tutorial on how to do it yourself! What is the current discussion about? One recent movement in the tech industry has been around changing the default "master" name to another name like "main". Note that if you delete a remote branch "X" from the command line using git push then it will also remove the local remote-tracking branch "origin/X" so there is no need to prune the obsolete remote-tracking branch with git fetch –prune or git fetch –p.If you're a software developer in 2020, you're likely familiar with the term "master" as the name of the primary branch of development in Git. To delete a particular local remote-tracking branch, you can use following command: A shorter version of the command is below: This will delete all the obsolete remote-tracking branches. git remote prune origin "deletes the refs to the branches that don't exist on the remote. Now, you need to delete the local references too. If you have deleted a remote branch using the command git push origin :, its references still exist in local code repo of your team members. It means it exists on our local machine cache but not on the remote repository. These are local branches that have a direct association with a remote branch. When we check out a local branch from a remote branch, it automatically creates what is called a tracking branch. What are tracking branches and how to delete them It will also remove the branch forcibly even if there are unmerged changes in the branch. Here is the command to delete branch locally: Please note that deleting a branch locally will not delete the remote branch. Your code repository should be neat, tidy, and easy to navigate. You should perform periodic cleanup of the branches where you would either remove the old branches or you would merge them into the master. You need to ensure that your Git repository is not a mess of outdated and old branches that are not being worked on anymore.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |