![]() ![]() If you have one remote now, and you add another, you will then have two remotes. What git remote add is for is to add a new remote. So most repositories already have a name origin. The git clone command automatically creates one remote, which it names origin unless you tell it to use some other name. Still, many if not most repositories have exactly one remote, because so many are created by git clone. While origin is a pretty standard remote name, it's not the only possible remote name-and your own repository may have no remote, in which case origin is not the name of one of your remotes, since you have none. The short answer is that a remote is just a name, but it's a name that is used to keep track of another Git repository, at some other URL. This may be because you are not sure what a remote is in the first place. It has ten (!) sub-commands:Įach sub-command may have its own sub-sub-commands or options and if run with no sub-commands at all, git remote simply lists all remotes.įor whatever reason, you are asking about only two of the ten sub-commands: add and set-url. The git remote command is meant for manipulating (working with, adding, and removing) remotes. It is rather a local alias set as a key for the remote repository URL. Origin is not the remote repository name. The repository doesn't even have to beĪ version of your repository, it may even be a completely unrelated Remote server, or it may even be the repository itself. ![]() Repository may be on your local computer in a different folder, on Note: This may seem as a duplicate of THIS but those answers are incomplete and do not explain the difference of changing the URL vs the "remote"?ĭoing some further googling: From this SO answer:Ī remote in git is basically a bookmark for a different repositoryįrom which you may wish to pull or push code. git config -local What are their differences? There seem to be at least 3 ways to do what sounds as the same thing. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |