We just learned that origin and master are two different things but sometimes we may get confused when we see the word origin/master.We can rename this branch by using the -m flag with the Git Branch command. Now, we can run the Git Branch command and see that we only have a single branch in our repository which is called the master. We will create an empty commit because a branch is just a pointer to a commit, and we will need one to view the master branch(the branch name is also visible in blue color next to the path of our directory). This name is just used to denote that it is the main branch of our repository.Ĭonsider the following example where we initialize a new Git repository. Again, there is nothing exceptional about this name, and we can rename our master branch to something else.All other branches will be created based on some commit of this branch and will eventually merge into the master branch. This branch will have the final, up-to-date, production-ready code.When a new Git repository is initialized using the Git Init command, it will only have a single branch and that branch, by default, is called the master.Master is the default name that Git gives to a branch when we create a new repository.We can also change this default name with the help of the Git Remote Rename command. We can see in the image below that we have a remote called origin. Next, we are going to check the remotes present by using the Git Remote command. First, we will run the Git Clone command, and pass the URL for the remote repository. There is nothing extraordinary about this word and we can use any other name that we like.Ĭonsider the example below where we try to clone a remote repository to our local system. It is a standard default name given to the repository from where our local repository originated.This name will be used in the future when we have to push or pull changes from the remote repository. ![]() In Git terminology, the origin is the name given to the remote repository from where we clone our local repository.
0 Comments
Leave a Reply. |