![]() Many people consider the name main to do a better job of describing this branch and its typical usage. It implies a relationship with some other, unnamed entity, but it doesnât represent the unique status of the initial branch. Aside from any offense it may cause, master isnât a particularly descriptive name anyway. The Git maintainers have worked with the wider development community to address these concerns. However, the term has become somewhat outdated for its association with colonialism. Other version control systems such as BitKeeper, a predecessor to Git, have also used the term. The master/slave terminology has a long history in computing, especially in reference to hardware such as disk drives. The just-created branch can be renamed via this command: git branch -m To configure the initial branch name to use in all of your new repositories, which will suppress this warning, call: git config -global faultBranch Names commonly chosen instead of 'master' are 'main', 'trunk' and 'development'. This default branch name is subject to change. Using 'master' as the name for the initial branch. We can see the new branch with the name 'hello-world-images', but the beside master specifies that we are currently on that branch. Recent versions of Git (2.28 and later) produce the following hint when you create a new repository using git init: The reason is I added a file file-2.Branch Naming and Why Master Is Being Phased Out You can use git branch âs -m / -move flag to rename a branch in our local repository. ![]() You can see this branch contains three files while master branch is showing only two files. See which files are listed now as compared to when we were on the master branch: git change branch name PROPERLY 3 Examples Step-1: Switch to the branch that you want to change the name in git Step-2: Change local branch name Step-3. For example, as listing the files by running the following command: Now, any work you do is associated with the hello-git-branch. You can see, no message is displayed, however, in brackets, the hello-git-branch is displayed. Run the checkout command for changing from master branch to our created branch on local repo:Īs I ran this command, see how it changed in the Git Bash: In Git, the clone command is used to fetch code from the remote repository. When you run git clone you have your Git call up some other Git.As such, SVN/CVS used clone command for switching the branches. It is showing two files in the master branch.Äid you know? Do not mix up the git checkout with git clone command if you have SVN/CVS background. The graphic below shows the current active branch in Git Bash:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |