![]() Try opening your git config by typing git config -e Then you would have 2 remotes (possibly more if you have other environments). A very common pattern is to use GitHub to store your code, and a server to host your application (if it's a web application). So you can certainly have multiple remotes. I would just add, that it becomes easy to understand if you think about remotes as locations other than your computer that you may want to move your code to. There is a really helpful video □ that explains all of this that can be found here. You can also see that both of the remote repositories have the same project name amazing-project and that gives us one reason why the remote repository names in the remote server and the shortnames in our local repositories should not be the same! In the above image you can see that I used the shortname friend to refer to my friend's remote repository. We can use the command git remote add in order to add a link to their remote repository in our local repository. And let's assume we want to be able to fetch code from their remote repository. Suppose we have a friend who forks our remote repository so they can help us on our project. I will answer that question with another example. So final question, why don't we just use the same name? In many cases you will have links to multiple remote repositories in your local repository and each of those will have a different shortname. And in our example above it is called origin.īasically origin is the default shortname that Git uses for a remote repository when you clone that remote repository. And this shortname kind of acts like an alias for the url, it's a way for us to avoid having to use that entire long url in order to push or fetch code. It is the shortname we are going to use whenever we want to push or fetch code from that remote repository. The other name that we have for our repository is the shortname that it has in our local repository that is related to the URL of the repository. And in our case that is 'amazing-project'. This can be kind of thought like a project name. Well one of the names that we have for our repository is the name it has on GitHub or a remote server somewhere. So why does it seem like there are two names for the remote repository? ![]() Now, this may be a bit confusing because in GitHub (or the remote server) the project is called 'amazing-project'. There you will see that in order to push or fetch code from your remote repository you will use the shortname 'origin'. If you run the command git remote -v it will list all the remote repositories that are linked to your local repository. The remote repository and the local repository are linked. Then you would have something like what you can see in the diagram below:īecause you cloned the repository. Suppose you have a remote repository called amazing-project and then you clone that remote repository to your local machine so that you have a local repository. A line of lead in both eras was known as a slug.Origin is the shortname that acts like an alias for the url of the remote repository. Later huge Linotype machines turned molten lead into casts of letters, lines, sentences and paragraphs. "The origin of the term slug derives from the days of hot-metal printing, when printers set type by hand in a small form called a stick. Usually the slug references the offer or headline and is used to differentiate between different ad runs. Advertisements usually have several markers, ad numbers or job numbers and slug lines. In the production process of print advertisements, a slug or slug line, refers to the "name" of a particular advertisement. The AP Stylebook prescribes its use by wire reporters (in a "keyword slugline") as follows: "The keyword or slug (sometimes more than one word) clearly indicates the content of the story." Sometimes a slug also contains code information that tells editors specific information about the story - for example, the letters "AM" at the beginning of a slug on a wire story tell editors that the story is meant for morning papers, while the letters "CX" indicate that the story is a correction to an earlier story. The story is labeled with its slug as it makes its way from the reporter through the editorial process. In newspaper editing, a slug is a short name given to an article that is in production.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |