7/1/2023 0 Comments Set origin as master gitWe work on these copied or feature branches and once the developed code is stable then only we merge it master branch and not all the developers have the permissions to do it. So when we have to work on the source code we create a copy from the master and this brach can be feature or custom. Anything done to the master will be tracked and occasionally audited. But default when you create a branch in a repository it will be called a master branch and this particular branch in the corporate development environment will be in sync with the production and we must be careful before we alter or merge anything to master. will be the bit bucket or GitHub branch name. Where the origin is the remote short name if there was not any name. We can use git push which will only when the user has the write access to send our work to the upstream from which we have cloned which will be origin remote. Alternatively, we can use git pull command which will automatically perform this combined task of downloading the data and merging it with master or whichever branch that is tracked by the git clone command when our working directory got created. It only downloads the data but will not automatically merge its local repository. So, in fact, git fetch origin will pull the updates to your working directory. So we have to fetch command for git which can be used to update the local repo where we cloned. We have seen that when we clone the code origin is default short name given to it. You can refer below screenshot where I have added test_get remote to and listed them with git remote -v option. We can add remote to repo we want to clone simple by using git remote add. To see more details of a repo we can give git remote -v as shown below and it will list all the remotes with their short names on which the programmer is working. I have cloned the repo from GitHub and kept in the test_git_tools directory which implicitly adds the repo called origin. In the below screenshot you can see these. If no name specified by default origin is the short name that’s given to the repo from which we might have cloned. This command lists them with their short names which admin or creator of repo might have mentioned while creating it. Git remote command can be used to get to know on which remote repo we are working. In this topic, we are going to learn about Git Origin Master. So when we collaborate with others on development we need to manage these repositories (also includes creating and removing repos) as well as pushing and pulling the data to them. These repos can be assigned read-write access categories depending on the type of users who are accessing them. Remote in contrast to the term suggests the availability of code on the server which can be local or connected by the internet. Basically, with git, you will be working on the remote repository which will be managed with versions by the git. When you work on any project with Git then knowing about its remote is necessary.
0 Comments
Leave a Reply. |