![Git In-depth](https://static.frontendmasters.com/assets/courses/2018-02-20-git-in-depth/thumb.webp)
Check out a free preview of the full Git In-depth course
The "Remotes" Lesson is part of the full, Git In-depth course featured in this preview video. Here's what you'd learn in this lesson:
Nina reviews remotes, which is a git repository store elsewhere on the web, in GitHub, or somewhere else. Origin is the default name git gives to the server from which you cloned the project. Cloning a remote repo from a URL fetches the whole repo and makes a local copy into your .git folder.
Transcript from the "Remotes" Lesson
[00:00:00]
>> Nina Zakharenko: What is a remote? I've mentioned this word a few times during class. A remote is a git repository that is stored somewhere else. Could be on the web, on github, maybe your company has a private git server. Origin is the default name that git gives to this server that you cloned from.
[00:00:15]
I'm sure you've seen origin lots of times and had no idea what it meant. So there you go. When you clone a repository from a URL, you're gonna fetch that whole repository and make a local copy in your .git folder. For these repositories you might have different privileges.
[00:00:32]
For example, you can read, write from your own repository, but you can't just write to someone else's repository without permission. So, someone else's repository as a remote is probably rude only for you. Now, when we clone a repository, let's say we have Lisa's GitHub in her computer, we make a copy called a clone on the local machine.
[00:01:04]
And origin is the default name that git gives to the server that you cloned from. By default, any operations push pull fetch they should they all work on origin. Unless you have your setup configured differently. If we wanna see what remotes we have set up it's easy you just do git remote-v.
[00:01:28]
That will show you in most repositories that you just freshly cloned off the web. You should just have an origin. In this case it's pointing to Lisa's version of project A.
>> Nina Zakharenko: What if you clone someone else's repository? You guys all cloned my exercises, advance git exercises repository, right?
[00:01:50]
>> Nina Zakharenko: What does that mean? Let's say Dan has a GitHub, and he's hosting this project. If Lisa clones it down to her local computer, she can pull down changes but she can't push them. She doesn't have permission to do so. She doesn't own the code.
Learn Straight from the Experts Who Shape the Modern Web
- In-depth Courses
- Industry Leading Experts
- Learning Paths
- Live Interactive Workshops